-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
[DevTools Bug]: With yarn@3.2.1 and PnP and react-devtools@4.24.7, yarn react-devtools
fails to start
#24682
Comments
I'm not familiar with PnP, but looks like when react-devtools is trying to locate its file |
I've opened a discussion over at yarnpkg/berry#4536 about this issue to see if someone can round out my understanding. |
It does, that's why you get a path within a zip file. This special virtual path can be loaded when the PnP runtime is live; we configure it via NODE_OPTIONS so usually it's not a problem, but perhaps Electron or react-devtools ignore this environment variable or override it. |
@arcanis Thanks for the information. react-devtools is running electron via Edit: I made sure that
But it's still not working. Maybe electron ignores it somehow. |
@mondaychen In reference to your comment on electron/electron#34470
const electron = require('electron');
const result = spawn.sync(electron, [require.resolve('./app')].concat(argv), {
stdio: 'ignore',
env: { NODE_OPTIONS: ... }
});
References Note: cross-spawn seems to be using nodejs' Edit: According to @arcanis's comment, and upon investigation, cross-spawn/spawn do seem to preserve env. |
Looking at electron/electron#13402, it seems Electron purposefully ignores NODE_OPTIONS, so it cannot access files located within zip archives 😕 Something you can try is to run |
@arcanis I believe that would be true for packaged apps, but devtools seems to be spinning up a non-packaged electron process, See https://www.electronjs.org/docs/latest/api/environment-variables#node_options |
Interesting - afaik cross-spawn (and spawn) default to preserve the env, so if it's not explicitly overridden I'd expect it to work then 🤔 |
@mondaychen That seems to be correct, bad speculation on my end. If environment is preserved then this is a non-issue. In any case, I think this would need further investigation and discussion before it gets to PR stage (if it's even needed). This definitely looks like an interesting behaviour. I'll follow this issue in any case and investigate if I can 😃 |
This is not only limited to
|
Website or app
https://github.com/wegry/pnp-and-react-devtools
Repro steps
yarn set version berry
)yarn add -D react-devtools
yarn react-devtools
How often does this bug happen?
Every time
DevTools package (automated)
No response
DevTools version (automated)
No response
Error message (automated)
No response
Error call stack (automated)
No response
Error component stack (automated)
No response
GitHub query string (automated)
No response
The text was updated successfully, but these errors were encountered: