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

Preview: MODULE_UNPARSEABLE when importing from '@prismicio/next' #103

Open
brunobely opened this issue Jan 23, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@brunobely
Copy link

brunobely commented Jan 23, 2025

Google results are largely unhelpful here so thought I'd raise an issue - I just set up Prismic in a Turborepo by following these docs and am getting this error when trying to open a page preview in Prismic. I set up the <PrismicPreview /> component and everything else seems to run OK.

slicemachine:dev: [next]  ⨯ Error: Could not parse module '[project]/node_modules/.pnpm/next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js'
slicemachine:dev: [next]     at [project]/node_modules/.pnpm/next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js [app-route] (ecmascript) (.next/server/chunks/f0296_next_3bdd13._.js:13914:11)
slicemachine:dev: [next]     at [project]/node_modules/.pnpm/next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/client/router.js [app-route] (ecmascript) (.next/server/chunks/f0296_next_3bdd13._.js:14004:37)
slicemachine:dev: [next]     at [project]/node_modules/.pnpm/@prismicio+next@1.7.1_@prismicio+client@7.15.1_next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0__react@19.0.0/node_modules/@prismicio/next/dist/PrismicPreview.js [app-route] (ecmascript) (.next/server/chunks/08b5e__pnpm_0cf084._.js:481:263)
slicemachine:dev: [next]     at [project]/node_modules/.pnpm/@prismicio+next@1.7.1_@prismicio+client@7.15.1_next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0__react@19.0.0/node_modules/@prismicio/next/dist/index.js [app-route] (ecmascript) <exports> (.next/server/chunks/08b5e__pnpm_0cf084._.js:765:395)
slicemachine:dev: [next]     at [project]/node_modules/.pnpm/@prismicio+next@1.7.1_@prismicio+client@7.15.1_next@15.1.0_react-dom@19.0.0_react@19.0.0__react@19.0.0__react@19.0.0/node_modules/@prismicio/next/dist/index.js [app-route] (ecmascript) (.next/server/chunks/08b5e__pnpm_0cf084._.js:791:403)
slicemachine:dev: [next]     at [project]/apps/slicemachine/src/prismicio.ts [app-route] (ecmascript) (apps/slicemachine/src/prismicio.ts:2:0)
slicemachine:dev: [next]     at [project]/apps/slicemachine/src/app/api/preview/route.ts [app-route] (ecmascript) (apps/slicemachine/src/app/api/preview/route.ts:4:0)
slicemachine:dev: [next]     at Object.<anonymous> (.next/server/app/api/preview/route.js:10:26)
slicemachine:dev: [next]   1 | import * as prismic from '@prismicio/client';
slicemachine:dev: [next] > 2 | import * as prismicNext from '@prismicio/next';
slicemachine:dev: [next]   3 | import config from '../slicemachine.config.json';
slicemachine:dev: [next]   4 |
slicemachine:dev: [next]   5 | /** {
slicemachine:dev: [next]   code: 'MODULE_UNPARSEABLE',
slicemachine:dev: [next]   page: '/api/preview'

Any ideas how I could debug this?

Here are the relevant package versions:

  dependencies
    "@prismicio/client": "^7.15.1",
    "@prismicio/next": "^1.7.1",
    "@prismicio/react": "^2.9.1",
    "next": "^15.1.0",
    "react": "^19",
    "react-dom": "^19.0.0"

  devDependencies
    "@slicemachine/adapter-next": "^0.3.65",
    "slice-machine-ui": "^2.12.2",
    "typescript": "^5.6.3"
@brunobely brunobely added the bug Something isn't working label Jan 23, 2025
Copy link

This issue has been labeled as a bug since it was created using the 🚨 Bug Report Template.

Hi there, thank you so much for the report!

Following our Maintenance Process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:

  • Information about your environment and packages you use (Node.js version, package names and their versions, etc.)
    Feel free to attach a copy of your package.json file.
  • Any troubleshooting steps you already went through
  • A minimal reproduction of the issue, and/or instructions on how to reproduce it

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request address it. Check out our quick start guide for a simple contribution process.

If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io

- The Prismic Open-Source Team

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

1 participant