ISR On-Demand Revalidation Error with revalidatePath #86503
Unanswered
kamomechan
asked this question in
Help
Replies: 1 comment
-
|
Perhaps the error in the console was not the key issue, because I subsequently abandoned the use of ISR and successfully solved the problem by using an SSG + API route hybrid render approach. However, a similar log is still displayed, and I'm not closing this topic for now because this is more of a workaround, and the core nature of the original problem has not been solved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The issue is with ISR (Incremental Static Regeneration) on-demand revalidation using revalidatePath. When running in the development environment, there are no problems.
However, when running in the production environment, after I perform an operation (like adding or deleting a comment) and execute the SQL operation within a Server Action, the subsequent call to revalidatePath to revalidate the data initially shows the page correctly updated with the new or deleted comment.
But when I manually refresh the page, I encounter this error and the 404 page is displayed:
Error: Internal: NoFallbackError at o (.next/server/chunks/ssr/_17042564._.js:2:1128) at responseGenerator (.next/server/chunks/ssr/_17042564._.js:2:2770).When I run
pnpm startagain, the previously deleted (old) comment data is displayed.I found that adding
export const dynamic = "force-dynamic";to the route segment config in/post/[id]/page.tsxin the production environment resolves the issue. However, I want to use ISR (Incremental Static Regeneration) for rendering.The source code is available at: https://codeberg.org/nokutan/moe-blog . I am using generateStaticParams to statically render the post pages based on MDX files. Comments are fetched from the database and rendered at the end of the post. When a comment is deleted or updated, I use revalidatePath to trigger the re-rendering of the static file. Since the project is still under development, if you need assistance with testing, you should set the environment variable .env
COMMENTS="true" POSTGRES_URL="your_url". You can use the data provided inapp/seed/route.tsby uncommenting the relevant section.Since I have now replaced ISR with SSG + API Route, if you want to reproduce the error, please switch to the specific commit hash by running
Beta Was this translation helpful? Give feedback.
All reactions