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

500 | Internal Server Error on blog posts #416

Closed
lwildermuth opened this issue Jul 12, 2024 · 3 comments
Closed

500 | Internal Server Error on blog posts #416

lwildermuth opened this issue Jul 12, 2024 · 3 comments

Comments

@lwildermuth
Copy link

lwildermuth commented Jul 12, 2024

Has anyone else experienced a 500 internal server error on blog posts after deployment?
Example URL: https://test-site.EXAMPLE.com/csrdcg308rwk7hmagrgdd2qt

@Sedong-Choi
Copy link

Sedong-Choi commented Jul 20, 2024

I has 500 internal error 'app-static-to-dynamic-error'

Plesae, Check vercel project's Log menu.
If you see the text 'Static to Dynamic Error' text, add this code.

// app/[domain]/[slug]/page.tsx
...
export const dynamic = 'force-dynamic';
...

Good Luck!

@joshualinog
Copy link

joshualinog commented Jul 21, 2024

TLDR the solution of @Sedong-Choi resolves the 500 error

@Sedong-Choi , i'm ignorant, but...

isn't this a bad thing? don't we want the pages to be rendered static for speed sake?

https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config

'force-dynamic': Force dynamic rendering, which will result in routes being rendered for each user at request time. This option is equivalent to getServerSideProps() in the pages directory.

additional info

the 500 error occurred for me after i manually changed the post slug from the auto generated string.
your addition to [slug]/page.tsx does fix the 500 error though as reported.

@lwildermuth
Copy link
Author

I has 500 internal error 'app-static-to-dynamic-error'

Plesae, Check vercel project's Log menu. If you see the text 'Static to Dynamic Error' text, add this code.

// app/[domain]/[slug]/page.tsx
...
export const dynamic = 'force-dynamic';
...

Good Luck!

This worked for me! Thank you for your help @Sedong-Choi

I'll close this issue

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

3 participants