-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add --ignoreDependencies to package command #439
Comments
Can you show me what a bundle file means? |
Like in here: https://code.visualstudio.com/api/working-with-extensions/bundling-extension#configure-webpack output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
}, The only thing that needs to be packaged is extension.js (bundle with all the required libs). But vsce still tries to look at node_modules even if it is not necessary (and sometimes this can cause issues). |
As mentioned here, once you start bundling, you should simply ignore |
@joaomoreno That does not solve the issue. I already have node_modules in my .vscodeignore. Even if node_modules is included in .vscodeignore , npm list is still run. That's the problem. Check the following files: Line 820 in 4960c7c
Line 182 in 3d7afdd
Line 57 in 3d7afdd
|
Ah the problem is that it still runs, and it throws an error? What error does it throw, btw? |
It doesn't necessarily always show an error. But in some scenarios it can show an error like the one described in the issue #246 . (the workaround proposed is to use My error looks like the one in the issue, but it is not the same one (although it is also caused by npm list). Unfortunately I can't post my exact error right now (I am not working in the project that have the issue). My packaging is working perfectly, but npm list show an error for some dependency that is not really important and that forbids packaging. Actually, I've never even run npm list before I found this issue. |
So... |
This comment has been minimized.
This comment has been minimized.
Npm version, 6.13.4, node version v12.16.1 |
npm install works without an issue. bundle. npm run package (node ./node_modules/vsce/out/vsce package")
|
Same issue
|
I'm having the exact same issue when using a Github Action to deploy a VSCode extension: It's in a monorepo using Lerna, and my VSCode extension package depends on another library in the repository: - packages/
- library/
- vscode-extension/ # (depends on library) There are 3 main jobs:
In the So IMO this |
I think a simple solution here would be to say that if |
I think the flag is useful because I use yarn 2 which has no |
I was able to work around the issue by downgrading to |
@joaomoreno do you still think we need more info? I see the label is still there. |
what information do we need for this? I've run into the same problem. I have an extension that includes other projects that are referenced directly during development, like below. npm install works fine, but the "dependencies": {
"@f5devcentral/f5-fast-core": "^0.7.0",
"@types/js-yaml": "^3.12.6",
"axios": "^0.21.1",
"f5-conx-core": "file:../f5-conx-core",
"f5-corkscrew": "file:../f5-corkscrew",
"js-yaml": "^3.14.1",
"keytar": "^6.0.1"
}
|
@joaomoreno For now using |
Will add a |
🎉 This issue has been resolved in version 1.102.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@joaomoreno please update the docs about bundling here
Or it will just die with the error from #439 (comment) |
I think that when this bug was fixed the ability to load the dependencies from package.json file did not work. Based on REAME.md file, we were supposed to be able to configure inside
While That is indeed a big deal if you do not call I tried to look at the d797b8d to spot the bug but I was not able to find exact what was missed. @joaomoreno If you could double check this and maybe give a hint on why setting this option in |
@ssbarnea Do you mind creating an issue explaining what exactly the bug is? |
Raise at #742 and PR will appear soon. |
This is to work around several issues use npm 7 or 8 with vscode packaging: * microsoft/vscode-vsce#439 * microsoft/vscode-vsce#673
This is to work around several issues use npm 7 or 8 with vscode packaging: * microsoft/vscode-vsce#439 * microsoft/vscode-vsce#673
* Update to node 16.13.10 * Update to vscode 1.67 api * Update to typescript 4.6.3 * Update to prettier 2.6.2 * Update shx to 3.3.4 * Update request-light to 0.5.8 * Update glob to 8.0.3 * Update semver to 7.3.7 * Update sinon to 14.0.0 * Update chai to 4.3.6 * Update mocha to 10.0.0 * Update @vscode/test-electron to 2.1.3 * Update better-ajv-erros to 1.2.0 * Update vsce to 1.103.1 * Use npm 6 for build & packaging This is to work around several issues use npm 7 or 8 with vscode packaging: * microsoft/vscode-vsce#439 * microsoft/vscode-vsce#673 * Fix for vscode tests on windows & mac
For some extension projects, people may use a bundle file instead of the regular
node_modules
.Even if we do that, we may get some errors, when running
Since vsce always tries to list/find dependencies as can be seen in issue #246 .
The workaround suggest is to use
--yarn
, since it will check for a yarn.lock file, and if it don't find, nothing happens and vsce doesn't runnpm list
command.Adding
node_modules
to ignore file won't help because this happens after we already tried to runnpm list
I propose here to add an option to package called
--ignoreDependencies
, so we don't run thegetNpmDependencies
and instead just return[cwd]
ingetDependencies
The text was updated successfully, but these errors were encountered: