Next.js Discord

Discord Forum

Navigation doesn't work the second time in production

Unanswered
Selkirk Rex posted this in #help-forum
Open in Discord
Selkirk RexOP
I have a Next 14.0.3 app in a Turborepo. When running with turbo dev everything works fine, but when I build and deploy it in a Docker container all links, be they <Link/> components or router.push() onClick events, don't work if I come back from the target, unless I refresh the page, as shown in the included GIF I captured.
This happens in all browsers I tried (Firefox, Chrome, Edge)

Adding logs to a relevant component I can see that the href is still present. I tried wrapping the components with <Link/> but that didn't work either.

As per the Turborepo documentation I am building in standalone mode and using the provided Dockerfile, adapted to reflect my project structure.

0 Replies