Storybook does not work in Nuxtjs Prismic tutorial

I'm going through the nuxtjs/prismic setup tutorial in the docs and when it gets to the point of using Storybook by running "npm run storybook" it fails. Storybook will not run, get several screen fulls of errors that seem to boil down to missing folders and files in the node_modules/@storybook folder. The @storybook folder is there but no vue subfolder, which is where are all the missing folder/files errors are coming from.

I've tried installing storybook via npm and since I'm using Nuxtjs installing the Nuxtjs/Storybook module. But the same errors persist.

Tried the command in the Slice Machine linked to the error that storybook in not running, "prismic sm --add-storybook" it asks to overwrite package.json and the nuxt config file, fails with errors. Unable to resolve dependency tree relating to webpack versions.

jdfadfad8:~/jornaltest$ prismic sm --add-storybook
? Which framework to use nuxt
? package manager npm
identical package.json
identical sm.json
identical nuxt.config.js
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: slice-library-starter-nuxt@0.0.0
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^4.44.2" from the root project
npm ERR!   webpack@"^4.44.2" from @storybook/vue@6.1.21
npm ERR!   node_modules/@storybook/vue
npm ERR!     dev @storybook/vue@"6.1.21" from the root project
npm ERR!   1 more (babel-loader)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from css-loader@6.2.0
npm ERR! node_modules/css-loader
npm ERR!   peer css-loader@"*" from @storybook/vue@6.1.21
npm ERR!   node_modules/@storybook/vue
npm ERR!     dev @storybook/vue@"6.1.21" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/jnobles/.npm/eresolve-report.txt for a full report.
1 Like

Hello @jamesnobles

Welcome to the Prismic community,

Can you tell me what is the node version and the Prismic CLI version you have? You can get that as the following

node -v
prismic --version

Looking forward to hearing from you back.

Thanks
Priyanka

prismic-cli/4.1.1 wsl-x64 node-v16.8.0

I switched to 14.17.6, this resolved an issue with running prismic theme command. However this did not resolve the issue with storybook.

What error do you get when you run the npm run storybook command?

It was missing the vue folder under node_modules/storybook.

I got it working while troubleshooting another issue with one of you colleagues. I switched to node 14.17.6 from 16.8/16.9 and using a beta version of the prismic-cli.

Great. I am glad it's working for you.
Don't hesitate to reach out to us if you have any questions.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.