vscode-js-debug: Cannot find module bootloader.js
Lately I’ve been getting this when trying to use the debugger (which now also doesn’t work)
Error: Cannot find module '/Users/[User]/.vscode/extensions/ms-vscode.js-debug-nightly-2020.3.217/src/bootloader.js'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)
at Function.Module._load (internal/modules/cjs/loader.js:847:27)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1285:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:439:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:66:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
pwa-node doesn’t work at all now 😦 But i can’t reproduce it on a public repo (it may not be related to the above)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 77 (35 by maintainers)
Commits related to this issue
- refactor: copy bootloader to storage dir for auto-attach, build updates Fixes https://github.com/microsoft/vscode/issues/96929 Fixes https://github.com/microsoft/vscode-js-debug/issues/374 The exten... — committed to microsoft/vscode-js-debug by connor4312 4 years ago
- update recommended vscode launch.json config (disable autoAttachChildProcesses) Auto attach would cause things such as Mapshaper's runCommandsXL() to fail, when running in OCI containers, as VSCode w... — committed to Vizzuality/marxan-cloud by hotzevzl 8 months ago
- update recommended vscode launch.json config (disable autoAttachChildProcesses) Auto attach would cause things such as Mapshaper's runCommandsXL() to fail, when running in OCI containers, as VSCode w... — committed to Vizzuality/marxan-cloud by hotzevzl 8 months ago
Because this is happening in tasks, I think you’re running into https://github.com/microsoft/vscode/issues/96375. You should be able to fix this by:
debug.node.autoAttach
to “disabled” (to clear previous bad state)on
oroff
, as you preferOkay, thanks. The solution for that issue is here: https://github.com/microsoft/vscode/issues/102057#issuecomment-657728467 If you’re running the latest 1.48, you should only need to do these two steps on workspaces where you have this issue:
(after this you can safely turn auto attach back on if you’d like to use it)
You can avoid that by setting
autoAttachChildProcesses: false
Please set
debug.node.autoAttach
todisabled
for the moment. This will be fixed in the upcoming recovery release.I discovered another case where this can happen with auto attach on extension version upgrade (https://github.com/microsoft/vscode/issues/96929). I applied a fix for it in the linked commit; you may see this one more time on the next version update, but after today’s nightly (which will be version 2020.5.517) it should no longer be an issue.
Verification steps:
node
and make sure it can attach.node
again. It should attach without errors.If anyone else finds this, this comment has the solution: https://github.com/microsoft/vscode/issues/137794#issuecomment-978093998
Tried that and I am still getting this error. I have checked the file system and the file exists, so can’t it find it?
Any chance you have that left over from the June 2020 release? That problem was prevalent before the recovery release there, and since then we’ll no longer put the bootloader in a tmpdir.
Do these steps fix the issue? https://github.com/microsoft/vscode-js-debug/issues/374#issuecomment-675020979
You can get around that by setting the debug
type
topwa-node
. Thenode
type goes through our “old” debugger, and its config schema doesn’t know about our new option.It looks like you have Node trying to run Node… what’s your launch config?
No worries, thanks for the detailed information 🙂
Faced same issue with
Unistalling and reinstalling fixed the problem for me.
I’m encountering a variation of this issue with a project that uses Node 10. I think what’s happening is the plugin initializes against my default Node version (17.x or whatever) and decides spaces in paths are fine. Then I switch to 10.15 (via nvm) and it chokes on “Application Support”:
If I remove the
NODE_OPTIONS
environment variable the error goes away.If I disable auto-attach it goes away and I can live with that for now, but if someone has a better idea I’m open to suggestions.
The next version should have the fixes, to be released in about 1.5 weeks. We reintroduce this general strategy, but with many more safeguards and fixes – tracked in https://github.com/microsoft/vscode-js-debug/issues/703
You can probably–I’ve not tested this–fix it globally by deleting (or renaming first, to be safe) your workspace storage folders to clear temp data. I believe by default on OSX this is
~/Library/Application Support/Code/User/workspaceStorage
Awesome, thanks, sent a Teams invite to the email on your GH profile
So, this illustrates my point. I did those steps afresh now, at your advice. I am running 1.48.0, but it didn’t work. Maybe I didn’t “wait a moment” long enough? But I’ve been through this so many times that I’m done with it. It just needs to be fixed, no more workarounds. If you have news of when that fix might arrive, I’m curious to know. In the meantime, I’ll just reach for other tools so I can get work done.
Sorry if this comes off as ungrateful, I do appreciate the hard work that your team is doing. VS Code is an amazing tool, and I’m sure it will continue to be. Thank you!
It’s for both stable and insiders.
Okay, cool. Note that the auto attach variables are set per-workspace, so you may need to do the toggle in multiple folders to clear them out fully
@huixisheng do you get that running things in the terminal? If so, you want to toggle auto attach to “disabled” and then back to on/off
I’m seeing the same issue in 1.47.1.
When I launch the debugger in the integrated terminal I get the following error:
^ this file exists
But running my action yields this error, it’s like the path isn’t escaped?
Setting
Debug > JavaScript: Use Preview
tofalse
doesn’t seem to fix it additionally settingDebug: Node: Auto Attach
todisabled
or toggling it from on/off -> disabled seems to have no affect. Restarting VS Code additionally doesn’t seem to have any affect.Its’ attempting to run under nvm with node version 10.16.3. It was all working prior to VS Code 1.47
When I upgrade to node 12.16.3 it works
@amlcodes you’re hitting a version of https://github.com/microsoft/vscode/issues/102035#issuecomment-656801666. The resolution steps in the comment will work for you (just ignore the electron part of it)
Issue still occurs for me with latest stable version of node and vscode…
sudo yarn
works for some reason though ??