Github Codespaces: spawn xdg-open ENOENT on wrangler dev
See original GitHub issueReally excited about this! I gave this a spin in Github Codespaces and ran into the following:
@irvinebroque ➜ /workspaces/project (main ✗) $ wrangler dev src/worker/index.ts
/usr/local/share/nvm/versions/node/v17.1.0/lib/node_modules/wrangler/wrangler-dist/index_node.js:27064
throw ex;
^
Error: spawn xdg-open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:475:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:475:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [
'https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=redacted&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20zone%3Aread%20offline_access&state=.....'
]
}
Node.js v17.1.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Error: spawn xdg-open ENOENT · Issue #6642 - GitHub
Description of the problem. Could not start service in the codesandbox below, command line threw "Error: spawn xdg-open ENOENT" error. image.
Read more >Wrangler fails with Error: spawnSync ENOENT on WSL2 #1597
Error: spawnSync /home/glen/.wrangler/bin/wrangler ENOENT at Object.spawnSync (internal/child_process.js:1070:20) at spawnSync (child_process.js:597:24) at ...
Read more >storefront:hot-proxy spawn xdg-open ENOENT #343 - GitHub
Description When using storefront:hot-proxy inside the docker container it results in the following error: ############ Storefront proxy ...
Read more >Unable to install wrangler globally inside a Docker container ...
I am trying to install wrangler inside a Docker container using the NPM -g flag. The Node was installed inside the container using...
Read more >wrangler dev in 11.0 is non-functional when there are ... - GitHub
I have a worker deployed with a very broad/non-specific route, *example.com/* . It handles some generic redirect behavior. I have other workers ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We definitely want to support environments like github codespaces (and codesandbox, stackblitz, all of them). For one, ee should have a better experience so this doesn’t crash immediately like it does. As a workaround, you can start the command with
--local
so it runs fully on the machine itself. That said, you might not be able to automate the opening of devtools either. We’ll get better at this. Leaving this issue open until we have a better story.Fixing the opening link part is simple, the problem which I’m not sure how should be properly solved is the localhost callback for auth.
What I think is probably easiest is accepting user input to retrieve the callback URL.
Something like:
Not ideal but would at least support codespaces, servers, etc to authenticate through OAuth.