Browser back and forward button renders code instead of pages

I recently upgraded my app from Next.js 14 to Next.js 15 and encountered a strange issue.

I have set the /events route as the default home route for my app. However, if you open a new tab and visit link I shared below, then go back (which takes you to the Google homepage), and then click the forward button in your browser history, the page doesn’t load properly.

Sometimes, it renders a file, and other times, it just displays code instead of the actual page.

You can check the issue here: https://dev.vongo.pro/events

I assume this is something related to caching?

I don’t know where I can look for it. Because in local environment it is working as I expect.

Added Suspense at the root of the server file. It worked.

1 Like

Thanks for sharing your solution here @jacoblsdev

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.