Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js cache not cleared on upgrade? #688

Closed
ChrisNolan opened this issue Sep 18, 2024 · 2 comments · Fixed by #698
Closed

Next.js cache not cleared on upgrade? #688

ChrisNolan opened this issue Sep 18, 2024 · 2 comments · Fixed by #698

Comments

@ChrisNolan
Copy link
Contributor

Describe the bug

The first start up after an upgrade results in errors from the ".next" "chunks".

I suspect this is because the 'cached'/'generated' page still exists in the .next folder, but the code itself has changed and some of the dynamic pieces is trying to use an old 'chunk'. I think likely there just has to be a process to remove the '.next' folder when doing an upgrade from one version to the next perhaps?


Got this error repeated in the logs until I first logged in

karrio.dashboard  | [auth][error] UnknownAction: Cannot parse action at /api/auth/_log. Read more at https://errors.authjs.dev#unknownaction
karrio.dashboard  |     at /app/.next/server/chunks/8481.js:1:79564
karrio.dashboard  |     at nr (/app/.next/server/chunks/8481.js:1:79734)
karrio.dashboard  |     at ca (/app/.next/server/chunks/8481.js:1:178046)
karrio.dashboard  |     at t (/app/.next/server/chunks/8481.js:1:188408)
karrio.dashboard  |     at /app/.next/server/app/api/auth/[...nextauth]/route.js:1:4071
karrio.dashboard  |     at s (/app/.next/server/chunks/4084.js:1:32311)
karrio.dashboard  |     at /app/.next/server/app/api/auth/[...nextauth]/route.js:1:4063
karrio.dashboard  |     at status (/app/.next/server/chunks/4084.js:1:29071)
karrio.dashboard  |     at s (/app/.next/server/chunks/4084.js:1:32311)
karrio.dashboard  |     at /app/.next/server/chunks/4084.js:1:29065

I believe it is probably just 'stale' generated nextjs stuff? Could there be a step in the migration to clear the nextjs cache (i.e. rm .next) so it will rebuild on first hit -- or, do we want to force the build of the nextjs system whenever a new image is spun up?

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@ChrisNolan
Copy link
Contributor Author

Oh, and I think this is likely also I had a tab open that was redirected to the login page as well and perhaps there is some script in the auth.js stuff which is trying to do the refreshes or something?

@danh91
Copy link
Member

danh91 commented Sep 21, 2024

Hi @ChrisNolan ,
I am investigating this. I suspect the issue might also come from the switch from Nextjs page router to app router.

@danh91 danh91 linked a pull request Sep 28, 2024 that will close this issue
9 tasks
@danh91 danh91 mentioned this issue Sep 28, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants