bug: can't build docker image with NextAuth.js
See original GitHub issueProvide environment information
System: OS: macOS 13.1 CPU: (10) arm64 Apple M1 Pro Memory: 111.53 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.3.0 - /opt/homebrew/bin/node npm: 9.2.0 - /opt/homebrew/bin/npm pnpm: 7.18.2
ct3aMetadata.initVersion: 6.11.2
Describe the bug
Build of my Next app fails due to missing env variables (I am using the SKIP_ENV_VALIDATION=1 env var) and Error: Failed to collect page data for /sign/in
To reproduce
- clone https://github.com/vojtechmares/training-platform
- checkout to branch
ci-docker-build
- run
docker build -t platform .
orSKIP_ENV_VALIDATION=1 pnpm run build
Additional information
I believe that the SKIP_ENV_VALIDATION
env var is not being passed to the app.
If I run the pnpn run build
outside docker without /.env
(/
is project root) file, I get the same error. Altho I was unable to turn off the validation even when I commented out the import in /next.config.mjs
.
I believe that the environment schema is checked when page data collection starts, since I was able to get this error for different pages.
Unfortunately I was unable to get around this issue.
I am using Next.js version 13.0.6
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (3 by maintainers)
cc @c-ehrlich @ajcwebdev You have more Docker experience than I have. Any ideas?
@c-ehrlich Ok, thank you. Completely understood, happy holidays 🎄