Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsce package is broken with npm workspaces #929

Closed
billti opened this issue Jan 30, 2024 · 20 comments · Fixed by #936
Closed

vsce package is broken with npm workspaces #929

billti opened this issue Jan 30, 2024 · 20 comments · Fixed by #936
Assignees
Labels
author-verification-requested bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@billti
Copy link
Member

billti commented Jan 30, 2024

See microsoft/qsharp#1091 where I had to pin to 2.22.0 to get our build to work again.

With 2.23.0 I get an error message running "vsce package --pre-release" that

 ERROR  Extension entrypoint(s) missing. Make sure these files exist and aren't ignored by '.vscodeignore':
  extension/out/extension.js

But the extension is in ./out/extension.js and always has been. You can see this specified at https://github.com/microsoft/qsharp/blob/main/vscode/package.json#L20 .

Pinning back to 2.22.0 resolves the issue.

I haven't had a chance to dig into this more yet. Raising ASAP for awareness.

@mweichert
Copy link

Having this issue as well.

mweichert pushed a commit to TezosTaqueria/taqueria that referenced this issue Jan 30, 2024
@Kubessandra
Copy link

Same

@remcohaszing
Copy link

This also affects non-browser extensions.

@goto40
Copy link

goto40 commented Feb 9, 2024

same effect for me.

@lars-reimann
Copy link

lars-reimann commented Feb 12, 2024

I've had the same issue after updating to v2.23.0 (see this CI run):

Error: Extension entrypoint(s) missing. Make sure these files exist and aren't ignored by '.vscodeignore':
extension/dist/extension/mainClient.cjs

vsce ls still shows that the file dist/extension/mainClient.cjs exists and v2.22.0 works fine.

lars-reimann added a commit to Safe-DS/DSL that referenced this issue Feb 12, 2024
### Summary of Changes

Downgrade `vsce` to `v2.22.0` while
microsoft/vscode-vsce#929 is open.
@sandy081 sandy081 added the bug Issue identified by VS Code Team member as probable bug label Feb 13, 2024
@sandy081 sandy081 added this to the February 2024 milestone Feb 13, 2024
@sandy081
Copy link
Member

Looks like this is something do with yarn workspaces feature support - #300

I believe those who are seeing this issue has your projects using yarn workspaces?

@sandy081
Copy link
Member

sandy081 commented Feb 13, 2024

Can you please try adding following flag --yarn to package command and see if it fixes?

for eg: vsce package --yarn

@goto40
Copy link

goto40 commented Feb 13, 2024

your projects using yarn workspaces?

No, but npm workspaces... I build the vsix in a project embedded in an npm workspace. I have no problem with a previous version of vsce.

@remcohaszing
Copy link

I ran into this in mdx-analyzer, which uses npm workspaces.

The output of the failed GitHub action is available on https://github.com/mdx-js/mdx-analyzer/actions/runs/7756736096/job/21154662574

@lars-reimann
Copy link

Looks like this is something do with yarn workspaces feature support - #300

I believe those who are seeing this issue has your projects using yarn workspaces?

NPM workspaces for me as well.

@billti
Copy link
Member Author

billti commented Feb 13, 2024

Seems we have a common pattern. Our VS Code package is also part of an npm workspace (https://github.com/microsoft/qsharp/blob/main/package.json).

@sandy081
Copy link
Member

I can reproduce this with npm workspaces. Will work on the fix. Thanks for info.

@sandy081 sandy081 changed the title 2.23.0 broke the build with a browser only extension vsce package is broken with npm workspaces Feb 14, 2024
sandy081 added a commit that referenced this issue Feb 14, 2024
@isidorn
Copy link
Contributor

isidorn commented Feb 14, 2024

Thank you for reporting this and for helping us find the issue.
We have started the investigation and I expect us to have a fix next week.
Until then I suggest to use the older version of vsce 2.22.0.

Sorry about that and thank you for your patience 🙏

@cipherdmg
Copy link

Hello Team,

First VSCode is simply awesome.

I also hit this exact same issue since I am not using yarn workspaces but I am using npm workspaces.

I did notice though just the presence of a .yarn folder even though I don't use yarn or have yarn dependencies then it works even though it does not use yarn. If I remove that folder then it breaks.

The paths to the extension are not resolving.

The npm.js getNpmDependencies() normalizes files from the directory where the package.json has workspaces in it which is 2 levels higher so I end up with normalized paths like this.

extension/../../apps/vscode/dist/extension.js

My package.json for my extension has "main": "./dist/extension.js", I also tried "main": "dist/extension.js",

So when it goes into package.js

onFile(file) {
    this.entryPoints.delete(util.normalize(file.path));
    return Promise.resolve(file);
}

This code that tries to delete the entryPoints LaunchEntryPointProcessor tries to delete the entryPoints but since they don't match it does not get deleted and then onFile() is called and throws an error.

vsce-v2 22 0-vs-v2 23 0

Hope the screen shot helps. My monorepo is broken so I have to move back to v2.22.0 until this gets fixed.

Thanks
CipherDMG

@sedrubal
Copy link

I ran into an issue which looks exactly similar to this one. However, I don't use workspaces. The reason was, that I've installed the Ubuntu snap nodejs package, which is broken. ➡️ Don't use snap

@joaomoreno
Copy link
Member

vsce 2.24.0 is out, can you see if that helps? Thanks for letting us know.

billti added a commit to microsoft/qsharp that referenced this issue Feb 23, 2024
The issue at microsoft/vscode-vsce#929 is
fixed now. I just tested locally and appears to work. If we can merge
this, I'll run a dev build and publish via ADO to verify.
@lars-reimann
Copy link

vsce 2.24.0 is out, can you see if that helps? Thanks for letting us know.

vsce package works again for Safe-DS/DSL using v2.24.0. Thanks for the fix!

@eleanorjboyd eleanorjboyd added the verified Verification succeeded label Feb 23, 2024
@billti
Copy link
Member Author

billti commented Feb 23, 2024

Seems to be working for us now. Thanks!

@cipherdmg
Copy link

Thanks team, this resolved my issue also.

remcohaszing added a commit to mdx-js/mdx-analyzer that referenced this issue Feb 27, 2024
Upstream issue microsoft/vscode-vsce#929 has
been fixed.
@goto40
Copy link

goto40 commented Mar 7, 2024

Works for me, too. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.