forge: vscode-nix script cannot find the other executables
Preflight Checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
- I did find https://github.com/electron-userland/electron-forge/issues/535, the closing PR for this issue introduced the problem I’m experiencing.
Issue Details
- Electron Forge Version:
- 6.0.0-beta.47
- Electron Version:
- v7.1.7
- Operating System:
- macOS 10.15.2
Expected Behavior
Using the launch configuration from https://www.electronforge.io/advanced/debugging in VS Code enables debugging for the new application.
Actual Behavior
The launch configuration errors with:
/Users/liamdawson/w/orcharduml/node_modules/.bin/electron-forge-vscode-nix --inspect-brk=35706
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/Users/liamdawson/w/@electron-forge/cli/dist/electron-forge-start'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
To Reproduce
yarn
v1.21.1npm
v6.13.4node
v10.16.3
Additional Information
I’m guessing it’s related to something about package nesting and/or symlinks?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Update VS Code debugger script Fix the debugger script to fix #1369, while still supporting the fix for #535. — committed to liamdawson/electron-forge by liamdawson 5 years ago
- Fix #1369 Ran in to #1369 today. This PR is @thinreyxu 's patch which fixed the issue for me. — committed to Gracecr/electron-forge by Gracecr 2 years ago
- chore: add electron VSCode launch setting for debugging main process ref: https://github.com/electron-userland/electron-forge/issues/1369#issuecomment-1172913835 — committed to grimmer0125/switchv by grimmer0125 2 years ago
- Update debugging.md, fixing runtimeExecutable path The problem identified at https://github.com/electron/forge/issues/1369 persists. This updates the documentation along with the suggestion at https:... — committed to jeffbmartinez/electron-forge-docs by jeffbmartinez a year ago
to fix it the
electron-forge-vscode-nix
file must be change fromto
Yet another workaround or solution for debugging:
In your
.vscode/ launch.json
and another script in
package.json
:(I don’t need any extra arguments, so I have not looked into that topic).
I’m having this problem as well using electron-forge 6.1.1 with MacOS 12.2.1.
I tried using the original VSCode launch config from the Electron Forge Docs:
I solved it by simply pointing the runtimeExecutable directly at the Bash script’s true location rather than the symlink to the same file that exists in
.bin/electron-forge-vscode-nix
The problem seems related to the expectation that this line from the script gets the location of th script gets the true location, but instead it gets the location of the symlink.
This is still an issue as of electron-forge @ 6.0.0-beta.61
Currently, patching this manually. Kinda brutal. Lets fix?
same issue. The problem is
Error: Cannot find module '/Users/liamdawson/w/@electron-forge/cli/dist/electron-forge-start'
but it missing node_modules in path 🤔@kresli thank you for this patch which worked with electron-forge 6.0.0-beta.61 on macOS with VSCode 1.62.3.
As someone who is new to Electron in general this was a really confusing and unfortunate issue for beginners.