svg-sprite icon indicating copy to clipboard operation
svg-sprite copied to clipboard

Storybook error after installing svg-sprite

Open iuliard opened this issue 2 years ago • 2 comments

Hi all,

After installing svg-sprite in a project, I wanted to add @nuxtjs/storybook. Got this error:

ERROR in ./generated-stories-entry.js
Module not found: Error: Can't resolve './.nuxt-storybook/storybook/@nuxtjs/svg-sprite/stories' in '/Users/...

Anyone got this error already and knows how to deal with it?

iuliard avatar Mar 15 '22 16:03 iuliard

We ran into this as well -- happens when upgrading to the latest nuxt/storybook. I ended up just disabling the integration in my nuxt config:

    storybook: {
      modules: {
        // with upgraded storybook, svg-sprite is crashing the storybook build.
        // It's not clear why that is, because it should have been fixed in
        // svg-sprite 0.5.1: https://github.com/nuxt-community/storybook/issues/155
        // That doesn't seem to have worked, however.
        exclude: ["svg-sprite"],
      },
    },

bmulholland avatar Mar 16 '22 18:03 bmulholland

As a temporary solution, you can specify the path to the sprite yourself and exclude library from modules.

stories: [
   './node_modules/@nuxtjs/svg-sprite/stories/**/*.stories.js',
 ],

webistomin avatar Jul 18 '22 06:07 webistomin