I have recently migrated to Nextjs 14 app router. My current folder structure looks like this:

When navigating between pages inside the dashboard layout it sometimes completely refreshes the page for no reason. This only happens in production. I could not reproduce this in development.
Here is a video: https://streamable.com/rsina7
My root layout /app/layout.tsx contains a react context which gets updated when for example users chat with one of the AI's.
The back button executes this: routing.push("/");
Same when clicking on the chat button: routing.push(chatPath); // chatPath is the path /