Using the launch configuration from https://www.electronforge.io/advanced/debugging in VS Code enables debugging for the new application.
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)
yarn v1.21.1npm v6.13.4node v10.16.3I'm guessing it's related to something about package nesting and/or symlinks?
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 馃
to fix it the electron-forge-vscode-nix file must be change from
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARGS=$@
ARGS=${ARGS// /\~ \~}
node $DIR/../../../@electron-forge/cli/dist/electron-forge-start --vscode -- \~$ARGS\~
to
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARGS=$@
ARGS=${ARGS// /\~ \~}
node $DIR/../@electron-forge/cli/dist/electron-forge-start --vscode -- \~$ARGS\~
I got the same issue on version 6.0.0-beta.52. So how about the following patch to the file electron-forge/packages/api/cli/script/vscode.sh:
#!/usr/bin/env bash
DIR="$( dirname "$( realpath "${BASH_SOURCE[0]}" )" )"
ARGS=$@
ARGS=${ARGS// /\~ \~}
node $DIR/../../../@electron-forge/cli/dist/electron-forge-start --vscode -- \~$ARGS\~
The only thing I try to fix this issue is to get the real path of the script file first, as showed on line 2 in the above code.
@thinreyxu that works for me. Thanks!
Most helpful comment
to fix it the
electron-forge-vscode-nixfile must be change fromto