-
Notifications
You must be signed in to change notification settings - Fork 994
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
fix NODE_OPTIONS
env forwarding
#11587
Conversation
Btw, when Yarn (berry) supports "normalized shell", so no need to use |
@cometkim Thanks for taking the time report. I'll get someone on our team to take a look. |
@cometkim Thanks for your PR. This looks very promising. I had no idea about yarn's updated abilities to help with cross environment stuff. That's great! I'm seeing some messages about Studio in your log output. And something about a debugger. I don't often start things from within vscode, I usually just run things from the terminal. Do you think you could add some more detailed reproduction steps? So I can clearly see the problem you're fixing and also see the fix working :) Thank you! 🙏 |
"Studio" is a truncated portion of the path to VSCode installed via Homebrew. (The actual path is The debug script is automatically injected when running with the VSCode |
Or I think you can reproduce the issue by providing a random export NODE_OPTIONS="--require /path/to/script with spaces.js"
yarn rw dev |
Hey @cometkim 👋 I think I was able to reproduce the issue with:
Using your changes (which look great) then the error no longer happens. One thing is that I still had to escape the value passed into require via |
I'm happy with these changes. If you confirm that it fixes the problem you were experiencing @cometkim then I'd be happy to merge once we fix any tests. |
Okay I'll just merge this and get it out. If it doesn't quite fix the problem then we can follow up. It would be ideal to follow up switching the other commands to use |
I got this error when executing `Run Dev Server` on the VScode ``` api | Waiting for the debugger to disconnect... api | node:events:497 api | throw er; // Unhandled 'error' event api | ^ api | api | Error: spawn Studio ENOENT api | at ChildProcess._handle.onexit (node:internal/child_process:286:19) api | at onErrorNT (node:internal/child_process:484:16) api | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) api | Emitted 'error' event on ChildProcess instance at: api | at ChildProcess._handle.onexit (node:internal/child_process:292:12) api | at onErrorNT (node:internal/child_process:484:16) api | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { api | errno: -2, api | code: 'ENOENT', api | syscall: 'spawn Studio', api | path: 'Studio', api | spawnargs: [ api | 'Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.js --inspect-publish-uid=http --enable-source-maps', api | 'yarn', api | 'nodemon', api | '--quiet', api | '--watch', api | '/Users/tim/Workspace/src/github.com/daangn/activity-badge-admin/redwood.toml', api | '--exec', api | 'yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter' api | ] api | } ``` Because the VSCode debugger injects this env variable, ``` --require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.js" --inspect-publish-uid=http ``` But not escaped correctly ``` yarn cross-env NODE_ENV=development NODE_OPTIONS="--require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.js" --inspect-publish-uid=http --enable-source-maps" yarn nodemon --quiet --watch "/Users/tim/Workspace/src/github.com/daangn/activity-badge-admin/redwood.toml" --exec "yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter" exited with code 1 ``` --------- Co-authored-by: Josh GM Walker <[email protected]>
I got this error when executing
Run Dev Server
on the VScodeBecause the VSCode debugger injects this env variable,
But not escaped correctly