Next.js Discord

Discord Forum

Nextjs 14.0.4 production error

Answered
Yellow Crazy Ant posted this in #help-forum
Open in Discord
Yellow Crazy AntOP
npm run dev works fine in local environment
npm run build works fine in local windows system

but when i'm trying to deploy the build files on aws ubuntu server, with nginx
nginx woks fine, but nextjs shows this error.
Can anyone please help me with this, i need this hosted by tonight

i'm using flask server as backend, which is working fine with nginx and hosted
this is also working fine, till nginx, but as it reaches nextjs it shows this error ?
please help ?
Answered by Yellow Crazy Ant
found a solution, had to downgrade to 13.4.19 and also had to make changes to the code completely..!
View full answer

8 Replies

Yellow Crazy AntOP
is it the slash issue,
because i'm building it on windows and deploying it on linux
if yes then how can i solve this ?
next/dist\client... this needs to be changed ?
where can i fix this
Toyger
yeah it's some problem with path, you can look here
https://github.com/vercel/next.js/discussions/56010
they have some workarounds, like changing \node_modules\next\dist\build\handle-externals.js or building your project in other environment like docker
Yellow Crazy AntOP
i hav already tried the fix mentioned, but still getting same issue
tried with 13.4.19, 14.0.2, 14.0.3, 14.0.4
14.0.4, has this already fixed, i need a way to build it on linux
Yellow Crazy AntOP
found a solution, had to downgrade to 13.4.19 and also had to make changes to the code completely..!
Answer