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

Prismic preview crashing in Next.js production with 500 error #108

Closed
levimykel opened this issue Jan 12, 2022 · 3 comments
Closed

Prismic preview crashing in Next.js production with 500 error #108

levimykel opened this issue Jan 12, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@levimykel
Copy link
Contributor

Versions

  • @prismicio/react: 2.0.2
  • react: 17.0.2
  • next: 12.0.1

Reproduction

I just updated from prismic-reactjs to @prismicio/react for the Prismic documentation website. Everything works as expected in local development, including previews. When deployed, however, everything crashes with a 500 error when I run a Prismic preview (everything works as expected when not in preview mode).

I'm getting the following error:

[GET] /docs/technologies/query-the-api-dotnet
2022-01-12T15:19:02.927Z
ERROR	TypeError: React.createContext is not a function
    at file:///var/task/node_modules/@prismicio/react/dist/index.js:7:30
    at ModuleJob.run (internal/modules/esm/module_job.js:145:37)
    at async Loader.import (internal/modules/esm/loader.js:182:24) {
  page: '/technologies/query-the-api-dotnet'
}
Error: Runtime exited with error: exit status 1
Runtime.ExitError
@levimykel levimykel added the bug Something isn't working label Jan 12, 2022
@angeloashmore
Copy link
Member

Hey @levimykel, I tried it on my side, both locally and in production (in my own separate account), and was unable to get this error.

Is it possible to redeploy the app on Vercel with a cleaned cache?

@levimykel
Copy link
Contributor Author

@angeloashmore Is there a specific way that you know of to clean a cache on Vercel? It seemed to me that the cache is cleared automatically anytime a new deployment is launched.

This was referenced Jan 14, 2022
@levimykel
Copy link
Contributor Author

@angeloashmore The update is working. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants