[devcontainer] Missing dependency and configuration
Product
Hot Chocolate
Version
15.0.0
Link to minimal reproduction
Local reproduction unsing devcontainer
Steps to reproduce
- Build & run a clean devcontainer from main branch (>Dev Containers: Rebuild Container Without Cache)
cd ./website/npx gatsby cleanyarn start
What is expected?
Website should launch
What is actually happening?
Failed to launch the browser process! /workspaces/graphql-platform/website/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
Relevant log output
vscode ➜ /workspaces/graphql-platform/website (main) $ yarn start
...
verbose Transition to "initializingData" > "sourcingNodes"
...
Error: Failed to launch the browser process!
/workspaces/graphql-platform/website/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
- BrowserRunner.ts:223 onClose
[website]/[puppeteer]/src/node/BrowserRunner.ts:223:9
- BrowserRunner.ts:209 Interface.<anonymous>
[website]/[puppeteer]/src/node/BrowserRunner.ts:209:50
- node:events:520 Interface.emit
node:events:520:35
- interface:555 Interface.close
node:internal/readline/interface:555:10
- interface:273 Socket.onend
node:internal/readline/interface:273:10
- node:events:520 Socket.emit
node:events:520:35
- readable:1701 endReadableNT
node:internal/streams/readable:1701:12
- task_queues:89 processTicksAndRejections
node:internal/process/task_queues:89:21
Additional context
Additionally, forwarded ports don't work as expected in devcontainer
libnss3 is only one of many needed dependencies: Debian (e.g. Ubuntu) Dependencies contains the full list
It can also be solved, by installing google chrome in the container Running Puppeteer in Docker
This might only be affecting Windows. I could reproduce it (Windows), but it works for Michael (macOS).
This might only be affecting Windows. I could reproduce it (Windows), but it works for Michael (macOS).
I also switched back to main and was suprised, that it worked, like it did for Michael. But it was due to cached data. To reproduce it in a clean way:
Switch to main branch
>Dev Containers: Rebuild Container Without Cache
cd website/
npx gatsby clean
npx gatsby build
It works if you use yarn serve -H 0.0.0.0 -p 9000.
There's something wrong with the dev server.
Hey,
I have tested this on main.
What I tested:
# current main commit
git rev-parse --short HEAD
# d71862ee03
# tried the original repro path from the issue
cd website
npx gatsby clean
gatsby <clean> can only be run for a gatsby site.
Either the current working directory does not contain a valid package.json or
'gatsby' is not specified as a dependency
// current website scripts on main
{
"dev": "next dev --hostname 0.0.0.0 --port 3000",
"build": "next build",
"start": "next start"
}
# current website flow checks
cd website
yarn build
timeout 25s yarn dev --port 3010
Result:
yarn buildcompleted successfully.yarn devstarted and became ready on0.0.0.0:3010.- I could not reproduce the old Puppeteer/Gatsby
libnss3.socrash on current main.
So this looks fixed/obsolete with the current website setup.