nuxt-modules / prismic

Easily connect your Nuxt.js application to your content hosted on Prismic
https://prismic.nuxtjs.org
MIT License
245 stars 48 forks source link

The requested module ...hast-util-whitespace... does not provide an export named 'whitespace' #216

Closed MarioC3 closed 4 months ago

MarioC3 commented 4 months ago

Versions

Reproduction

https://stackblitz.com/edit/nuxt-starter-rxtw93 https://stackblitz.com/github/nuxt-modules/prismic/tree/master/examples/minimal?file=pages%2Findex.vue -> Your starter is broken as well.

Steps to reproduce

When starting the Nuxt's environment via yarn dev, the server shows a bunch of warnings, and ultimately errors out:

[nuxt] [request error] [unhandled] [500] The requested module './../_node_modules/hast-util-whitespace/lib/index.js' does not provide an export named 'whitespace'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:122:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:188:5)  
  at async DefaultModuleLoader.import (node:internal/modules/esm/loader:228:24)  
  at async ViteNodeRunner.interopedImport (./node_modules/vite-node/dist/client.mjs:421:28)  
  at async ViteNodeRunner.directRequest (./node_modules/vite-node/dist/client.mjs:280:24)  
  at async ViteNodeRunner.cachedRequest (./node_modules/vite-node/dist/client.mjs:206:14)  
  at async ViteNodeRunner.dependencyRequest (./node_modules/vite-node/dist/client.mjs:259:12)  
  at async ./node_modules/@nuxtjs/prismic/dist/runtime/plugin.js:8:31  
  at async ViteNodeRunner.runModule (./node_modules/vite-node/dist/client.mjs:399:5)  
  at async ViteNodeRunner.directRequest (./node_modules/vite-node/dist/client.mjs:381:5)

What is Expected?

That Nuxt starts normally.

What is actually happening?

Nuxt is erroring out. ๐Ÿ˜ญ

MarioC3 commented 4 months ago

Digging a little bit more, I think the bug was introduced on @prismicio/client 7.7.0. When adding some of the hast dependencies.

If I add "@prismicio/client": "7.6.0" to my resolutions, nuxt starts normally.

lihbr commented 4 months ago

Hi @MarioC3, thanks! I'll have a prompt look into it.

Indeed, for now pinning the dependency work as a temporary fix. I'll let you know when we fix it for good (hopefully today)

lihbr commented 4 months ago

Hi there,

Once again, thank you so much for reporting this issue and trying out the latest version of our kit!

This should now be fixed in @prismicio/client v7.7.4, update with:

npm update @prismicio/client

P.S. I'm aware of the warning spam going on about some source map not loading. This appears to be caused by: https://github.com/inikulin/parse5/issues/1194 (also related: https://github.com/nuxt/content/issues/2663), I'll see what I can do about it.

I'm gonna close this issue as everything checked in our QA process. If you still experience the issue with the latest version, you're very welcome to reopen this issue!

Thanks again ๐Ÿ™