slice-machine-ui 1.4.0: "Error: Cannot find module 'next/headers'"
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!
Also, this release seems to have several issues:
- The build status of the publish commit is red.
- The weight of the package is 13.5 MB according to npm, even bundlephobia is crashing when trying to analyze it.
Any news on this? 👋
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.
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?