-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WDS 3.x -> 4.6.0 : Error: spawn chrome ENOENT #4083
Comments
Please use:
It is small breaking change on feel free to feedback |
Try to open your terminal and run |
commands like "chrome" or similar don't work in the terminal - with WDS 3.x as well as in 4.6.0. we're in a vsCode terminal inside a docker container - nothing changed here but the versions of the webpack packages. for clarification: |
We really do not change nothing, just refactor options and update |
Maybe related sindresorhus/open#270 |
Yeah. In particular, you can install $ sudo apt-get update
$ sudo apt-get install xdg-open Then, you can try edit the source code in if (app) {
command = app;
} else {
// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
const isBundled = !__dirname || __dirname === '/';
// Check if local `xdg-open` exists and is executable.
let exeLocalXdgOpen = false;
try {
await fs.access(localXdgOpenPath, fsConstants.X_OK);
exeLocalXdgOpen = true;
} catch {}
// const useSystemXdgOpen = process.versions.electron ||
// platform === 'android' || isBundled || !exeLocalXdgOpen;
// command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;
command = 'xdg-open';
} Finally,u can use as follow:
Don't add More info : sindresorhus/open#270 At least this solved my problem, good luck! I agree with @alexander-akait ‘s point of view that open source libraries should consider more public needs. Of course, as developers, we can re-explore, modify or propose pr improvements based on open source libraries. |
Bug report
I'm running WDS 4.6.0 from a docker container inside WSL2. I configured the devServer to automatically open Chrome with certain arguments:
Actual Behavior
WDS throws the following error:
When I remove the whole app argument for Chrome, WDS runs fine, even autostarts the os default browser and also correctly updates on code changes.
I have to admit, I'm new to WSL2 and Docker and a bit confused by it. There of course is no window manager or browser in the container. Everything gets handed over to chrome on my windows host. Nonetheless I tried to change the browser application name to google-chrome. Nothing changed. But I suspect this aspect not to be the problem, since everything works fine with an older version of WDS (see below).
Expected Behavior
Until very recently I was running WDS 3.11.2 in exactly the same WSL2/Docker environment and webpack-config, but with this old syntax:
Works fine! No problem at all. It would be nice if the newer versions behaved similarly cooperative.
How Do We Reproduce?
webpack-cli info
WDS part of my webpack-config:
My WSL2/docker environment and my webpack-config (except the new syntax for open) have not changed when switching versions from 3.11.2 to 4.6.0!
webpack-cli info BEFORE UPDATING TO 4.6.0
Please let me know if you need any additional information.
:)
The text was updated successfully, but these errors were encountered: