Nuxt.js + Prismic configuration: dependency not found

Hi, I have tried to perform the configuration steps as described here but I am no longer able to run "npm run dev" in my nuxt project due to the following error:

This dependency was not found:

  • @prismicio/vue/components/common in ./.nuxt/prismic/plugins/prismic-components.js
    To install it, you can run: npm install --save @prismicio/vue/components/common

Nuxt version: Nuxt @ v2.15.3
Npm version: 6.14.11 (node ​​v14.16.0)
Prismic version: 3.8.9

I tried to install "npm install --save @prismicio/vue/components/common" but it doesn't solve the problem.

Any suggestions?
Thank you!

Hey Matteo,

The build version 2.0.8 of @prismicio/vue was messed up, but it was fixed in version 2.0.9.

The fix is simple run:

yarn upgrade @prismicio/vue@^2.0.9

or

npm update @prismicio/vue@^2.0.9

Or delete the node_modules & the lock file and install again :slightly_smiling_face:

Thanks.

Hi there,

Reviving this thread, I've just run into this problem today with:
@nuxtjs/prismic@1.4.2
@prismicio/vue@2.2.0
nuxt@2.15.8

Any chance you'd be able to help me with a solve for this?

Hello @developer2,

I have the same setup on my end, and it works fine.

Can you tell me what node version you have? You can get that by running this command:

node -v

And can you also try deleting your node_modules as @Phil said? And try rerunning the command.

Cheers,
Racheal.

Hi @racheal.orukele ,

I've tried with both node v14.19.0 and v16.14.0 and they both have the same issue. I've also tried deleting and re-installing the node-modules folder on both node versions as well and the problem persists.

I don't know if this helps, but I'm not starting from a fresh project, I'm trying to add Prismic into an existing project. I followed the nuxt guide and this started happening after I ran npx @slicemachine/init

I see this error when I run npm run dev

Not sure why or how it got into that state, but by deleting both the package-lock.json and the node_modules again on node v14.19.0, I was able to make the error disappear.

Oh, that's great to hear, and thanks for sharing your fix on the issue. Let us know if you have any other questions :slightly_smiling_face: