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

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

Open
loick opened this issue Jul 3, 2023 · 4 comments
Open

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

loick opened this issue Jul 3, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@loick
Copy link

loick commented Jul 3, 2023

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 loick added the bug Something isn't working label Jul 3, 2023
@loick
Copy link
Author

loick commented Jul 4, 2023

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.

@loick
Copy link
Author

loick commented Jul 10, 2023

Any news on this? 👋

@angeloashmore
Copy link
Member

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
Copy link
Author

loick commented Jul 11, 2023

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?

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