prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
153 stars 40 forks source link

slice-machine-ui 1.4.0: "Error: Cannot find module 'next/headers'" #189

Open loick opened 10 months ago

loick commented 10 months ago

Hi there,

I noticed the following error on the slice-machine-ui version 1..4.0: Error: Cannot find module 'next/headers'

As explained in a previous issue raised, my package does not rely on nextJS. I added the nextJS adapter because I had to choose one, but my JS module is actually SSR framework agnostic (I rely on React though).

If I can do anything to help, let me know.

Thanks!

loick commented 10 months ago

Also, this release seems to have several issues:

loick commented 9 months ago

Any news on this? 👋

angeloashmore commented 9 months ago

Hi @loick, you can likely fix this issue by installing Next.js v13 as a dev dependency:

npm install --save-dev next@latest

As long as you aren't using any of Slice Machine's generated files (except the TypeScript types in prismicio-types.d.ts), the next package shouldn't affect your project.

You could also check your project for any instances of next/headers and remove them. @slicemachine/init generates a /api/preview endpoint in Next.js projects which uses next/headers. If you have that file, you can delete it.

loick commented 9 months ago

Hi Angel,

I would like to avoid installing big dependencies like this (13.5Mb for slicemachine is huge), and in addition putting NextJS inside my project is highly confusing (especially because I don't use it).

Is it possible to simply have the ability to query the CMS content, only be tied to React or Vue eventually and that's it?