-
SummaryHey I am in the process of dockerising my next app and I cannot seem to get it to work. Everything works fine outside docker (dev and build then start).
My dockerfile is
I've genuinely ran out of ideas. Ive tried adding removing everything from my next config, .dockerignore, trying different base images, tried yarn, running a shell inside the container to see around, with / without a custom server, downgrading to 14.1, trying latest next version (currently on), different next config output settings, Nothing. -- I've wasted like 5 hours on troubleshooting and I'm stumped! Any suggestions are appreciated! Additional informationDockerignore node_modules ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
hey @dymoo, you can follow this example from PS (standalone): Sometimes if you build the standalone and then run dev after you might get an error. so I deleted the |
Beta Was this translation helpful? Give feedback.
-
Console output
I've removed every single dependency, basically everything from the TSX files? This ONLY happens in the docker container (I've tried my own as well as nextjs default one) -- Cannot reproduce it on my local machine ? |
Beta Was this translation helpful? Give feedback.
-
2 f--ing days of my life! chased it down to ./app/app/layout.tsx if the contents of the file is
it breaks everything (only in production) but if I change it to a JSX file and the contents to
it works absolutely fine. I will report this as a bug in Next, EDIT: I fixed it in my repo but am unable to reproduce the fix in a example repo? the broken page is still there? EDIT 2: #65380 |
Beta Was this translation helpful? Give feedback.
2 f--ing days of my life!
"Fixed" it, it's got to be a bug in nextjs.
chased it down to ./app/app/layout.tsx
if the contents of the file is
it breaks everything (only in production)
but if I change it to a JSX file and the contents to
it works absolutely fine.
I will report this as a bug in Next,
EDIT: I fixed it in my repo but am unable to reproduce the fix in a example repo? the broken page is still there?
https://github.com/dymoo/next-docker-layoutbroken-example
EDIT 2: #65380