Application error appears randomly on navigation
Unanswered
cyrielle6454 posted this in #help-forum
Hello,
For several weeks, we are facing a bug on our NextJS application. Sometimes, when a user navigates to a page, the default error page "Application error: a client-side exception has occurred" is displayed on staging and production. We never encountered it in local development.
This is what we know so far:
- The error in the console log is due to an undefined page props that is provided in
- The bug appeared after we added the middleware
- We implemented the temporary fix from this issue but it had no impact on the bug frequency: https://github.com/vercel/next.js/issues/47516
- We disabled prefetch on all the app with the code in the following screenshot, and the bug frequency was largely reduced but it is still occurirng.
Does this sound familiar? Do you have any tips (especially on how to get more information)?
Our NextJS version is 14.1.0
For several weeks, we are facing a bug on our NextJS application. Sometimes, when a user navigates to a page, the default error page "Application error: a client-side exception has occurred" is displayed on staging and production. We never encountered it in local development.
This is what we know so far:
- The error in the console log is due to an undefined page props that is provided in
getStaticProps. The props is a constant and there is no server call.- The bug appeared after we added the middleware
- We implemented the temporary fix from this issue but it had no impact on the bug frequency: https://github.com/vercel/next.js/issues/47516
- We disabled prefetch on all the app with the code in the following screenshot, and the bug frequency was largely reduced but it is still occurirng.
Does this sound familiar? Do you have any tips (especially on how to get more information)?
Our NextJS version is 14.1.0
2 Replies
@cyrielle6454 Hello,
For several weeks, we are facing a bug on our NextJS application. Sometimes, when a user navigates to a page, the default error page "Application error: a client-side exception has occurred" is displayed on staging and production. We never encountered it in local development.
This is what we know so far:
- The error in the console log is due to an undefined page props that is provided in `getStaticProps`. The props is a constant and there is no server call.
- The bug appeared after we added the middleware
- We implemented the temporary fix from this issue but it had no impact on the bug frequency: https://github.com/vercel/next.js/issues/47516
- We disabled prefetch on all the app with the code in the following screenshot, and the bug frequency was largely reduced but it is still occurirng.
Does this sound familiar? Do you have any tips (especially on how to get more information)?
Our NextJS version is 14.1.0
Firstly, definitely dont do this.
Secondly the error is clearly coming from a page trying to use a undefined variable. Check around to see where you are reading "name"
Secondly the error is clearly coming from a page trying to use a undefined variable. Check around to see where you are reading "name"
Hello,
We disabled the prefetch to prevent the bug from happening too much in production, but this is a temporary fix and we know that this is a bad practice.
This is a schema explaining which variable is undefined, it is the page props injected in
We disabled the prefetch to prevent the bug from happening too much in production, but this is a temporary fix and we know that this is a bad practice.
This is a schema explaining which variable is undefined, it is the page props injected in
getStaticProps