question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: can't build docker image with NextAuth.js

See original GitHub issue

Provide 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

  1. clone https://github.com/vojtechmares/training-platform
  2. checkout to branch ci-docker-build
  3. run docker build -t platform . or SKIP_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:open
  • Created 9 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
juliusmarmingecommented, Dec 21, 2022

cc @c-ehrlich @ajcwebdev You have more Docker experience than I have. Any ideas?

0reactions
vojtechmarescommented, Dec 22, 2022

@c-ehrlich Ok, thank you. Completely understood, happy holidays 🎄

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting error while converting my next js project to docker
The Dockerfile I got from the next js github page worked fine for me and I got a build successfully. # Install dependencies...
Read more >
Errors - NextAuth.js
Errors. This is a list of errors output from NextAuth.js. All errors indicate an unexpected problem, you should not expect to see errors....
Read more >
next-auth is not working with Next 12.2.3 · Issue #5008 - GitHub
I have a lead, so I'll talk with the Next.js team to confirm if it's a bug there, but I think it is...
Read more >
Unable to build my docker image
I have a created a project as well as dockerfiles inside it. I'm trying to run it from docker but I keep getting...
Read more >
How to Make Twitter API Requests with NextAuth.js Session ...
What are we going to build? Step 0: Creating a new NextAuth.js authenticated Next.js app; Step 1: Accessing Twitter oAuth tokens in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found