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

Error starting debugger when Vscode and Node are installed from Ubuntu Snapstore #102723

Closed
mwoz123 opened this issue Jul 16, 2020 · 6 comments
Closed
Assignees

Comments

@mwoz123
Copy link

mwoz123 commented Jul 16, 2020

  • VSCode Version: Snap, details below
  • OS Version: Ubuntu 20.04
    Version: 1.48.0-insider
    Commit: cb31fc6
    Date: 2020-07-15T05:32:05.866Z
    Electron: 8.3.3
    Chrome: 80.0.3987.165
    Node.js: 12.13.0
    V8: 8.0.426.27-electron.0
    OS: Linux x64 5.4.0-40-generic snap

Steps to Reproduce:

  1. Install from snapstore:
  • VSCode or VScode Insider
  • Node 14 (!also from snapstore)

2.Create react app or clone my sample clear VSCode React project: https://github.com/mwoz123/test-vsc-snap-react (contains only files generated by create-react-app script + launch.json + settings.json -> see comits)

  1. run npm i

  2. Open in VSC folder test-vsc-snap-react

  3. Try debugging react app in VSC using "Debug ReactJS Dev server" launch config.

Previously I'd
The node version in "/snap/bin/node" is outdated(version), we require atleast Node 8.x
but after applying (commited to repo) workaround:
#102355 (comment)

I've error:

/snap/bin/node --inspect-brk=49578 node_modules/react-scripts/scripts/start.js --inspect-brk=39841 
ℹ 「wds」: Project is running at http://192.168.1.22/
PrefixFactory.js:55
ℹ 「wds」: webpack output is served from 
PrefixFactory.js:55
ℹ 「wds」: Content not from webpack is served from /home/marcin/workspace/test-react/test-vsc-snap-react/public
PrefixFactory.js:55
ℹ 「wds」: 404s will fallback to /
PrefixFactory.js:55
Starting the development server...

start.js:157
Error: EACCES: permission denied, read
Emitted 'error' event on ReadStream instance at:
    at internal/fs/streams.js:217:14
    at FSReqCallback.wrapper [as oncomplete] (fs.js:524:5)

Software installed from snapstore:


marcin@dell:~$ snap list
Name                     Version                     Rev   Tracking         Publisher        Notes
canonical-livepatch      9.5.5                       95    latest/stable    canonical✓       -
chromium-ffmpeg          0.1                         15    latest/stable    canonical✓       -
clementine               latest                      890   latest/stable    kz6fittycent     -
code                     485c41f9                    37    latest/stable    vscode✓          classic
code-insiders            cb31fc6c                    482   latest/stable    vscode✓          classic
core                     16-2.45.1                   9436  latest/stable    canonical✓       core
core18                   20200707                    1880  latest/stable    canonical✓       base
gimp                     2.10.20                     281   latest/stable    snapcrafters     -
gnome-3-28-1804          3.28.0-17-gde3d74c.de3d74c  128   latest/stable    canonical✓       -
gnome-3-34-1804          0+git.3009fc7               36    latest/stable/…  canonical✓       -
gtk-common-themes        0.1-36-gc75f853             1506  latest/stable/…  canonical✓       -
kde-frameworks-5-core18  5.61.0                      32    latest/stable    kde✓             -
node                     14.4.0                      2799  14/stable        nodesource✓      classic
opera                    69.0.3686.77                82    latest/stable    opera-software✓  -
qmmp                     1.4.0                       5     latest/beta      the-mentor       -
snap-store               3.36.0-80-g208fd61          467   latest/stable/…  canonical✓       -
snapd                    2.45.2                      8542  latest/stable    canonical✓       snapd
snapdiff                 0.1                         1     latest/stable    mwhudson         classic
teams-for-linux          1.0.5                       105   latest/stable    alarconj         -
marcin@dell:~$

Does this issue occur when all extensions are disabled?:
Yes

Exactly same behaviour for non-insiders version:
Version: 1.47.1
Commit: 485c41f
Date: 2020-07-14T00:13:57.513Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.0-40-generic snap

@mwoz123
Copy link
Author

mwoz123 commented Jul 16, 2020

From command line npm start starts react server without any problems.

@connor4312
Copy link
Member

It seems like one workaround is setting "console": "integratedTerminal", (does not need debug.javascript.usePreview to be false)

Interestingly I don't see this happen even if I use the VS Code electron instance to spawn the start script...

ELECTRON_RUN_AS_NODE=1 /snap/code-insiders/479/usr/share/code-insiders/code-insiders -e 'require("child_process").spawn("/snap/bin/node", ["node_modules/react-scripts/scripts/start"], { stdio: "inherit", env: process.env });' # works

...it only seems to happen (on both the old and new debuggers) when started from the extension host. (Though maybe snap does extra sandboxing when launching the app which the CLI doesn't.)

We can launch Node when it's installed via apt or nvm just fine, only snap node is busted.

cc @joaomoreno / @deepak1556 if you have any idea what's going on here. Daniel isn't sure and I've no familiarity with snap internals. Leaning towards this being an upstream issue in snap or Node's snap image.

@joaomoreno
Copy link
Member

@mwoz123
Copy link
Author

mwoz123 commented Jul 17, 2020

@connor4312 - workaround "console": "integratedTerminal", in launch.json works for me,
but only when I've "debug.javascript.usePreview": falsein settings.json.

Without usePreview: false I'm again getting:
The node version in "/snap/bin/node" is outdated(version), we require atleast Node 8.x

@connor4312
Copy link
Member

@mwoz123 if you update to the most recent insiders or use the js-debug nightly build it should work without disabling preview.

@joaomoreno quote possibly. There seem to be multiple 'weird' things about Node Snap.

@connor4312
Copy link
Member

I don't think there's anything actionable from the VS Code side on this.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants