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

Page changed from static to dynamic at runtime /dashboard, reason: unstable_noStore() #661

Closed
dexhowl opened this issue Apr 29, 2024 · 1 comment

Comments

@dexhowl
Copy link

dexhowl commented Apr 29, 2024

Context: Just Finished Chapter 15

After logging in successfully, I am redirected to the dashboard route as expected.

However, when the app is deployed to my Vercel instance I receive the following error messages in logs.

  1. [GET] /dashboard status=500

Page changed from static to dynamic at runtime /dashboard, reason: unstable_noStore()
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error
   at s (/var/task/.next/server/chunks/943.js:2:48780)
   at i (/var/task/.next/server/chunks/217.js:1:6641)
   at i (/var/task/.next/server/chunks/158.js:1:2291)
   at w (/var/task/.next/server/app/dashboard/(overview)/page.js:2:2519)
   at eh (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786)
   at e (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671)
   at ek (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145)
   at Object.toJSON (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135755)
   at stringify (<anonymous>)
   at eR (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142219) {
 page: '/dashboard'
}
  1. Error: Runtime exited with error: exit status 1

Note: Functionality doesn't appear to be impacted. I'm mostly just curious if there's a reason this happens or a way to fix it.

The potential fix I found was export const dynamic = 'force-dynamic'. Unfortunately, I have not been able to confirm it works yet.
Though, to me, that feels more like a workaround than an actual fix and of course I could be wrong about that.

I have yet to see these errors when running in my local environment and it doesn't seem to impact performance of the app. Everything continues to work as far as I can tell.

I did a rollback to (Chapter 14) before I added the login functionality, and the errors don't appear in logs anymore when visiting the dashboard page.

The previous deployment I rolled back to was using Next v14.2.2 and the new one is 14.2.3. and node 18.x instead of node 20.x
Not sure if that's totally relevant but figured it would be worth mentioning.

Edit: I just noticed another 500 error logged on sign out.

Unhandled Rejection: TypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed
at ReadableStreamDefaultController.enqueue (node:internal/webstreams/readablestream:1073:13)
at fetchParams.controller.resume (node:internal/deps/undici/undici:10897:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_STATE'
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unknown application error occurred.
@leerob
Copy link
Member

leerob commented Jun 23, 2024

Fixed here: #764

@leerob leerob closed this as completed Jun 23, 2024
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

No branches or pull requests

2 participants