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

Error using addon on StoryBook 6.1.11 #76

Closed
suzzlo opened this issue Dec 17, 2020 · 2 comments
Closed

Error using addon on StoryBook 6.1.11 #76

suzzlo opened this issue Dec 17, 2020 · 2 comments
Labels
category: question Further information is requested

Comments

@suzzlo
Copy link

suzzlo commented Dec 17, 2020

Hi,

I'm sure I'm doing something wrong, but I cannot figure out how to solve it. This is my situation (after adding addon to main.js file):

`
$ npm run storybook
sgre-components@1.0.169 storybook C:\Users\ion.gonzalez\source\repos\E2E\E2ePor\Components
start-storybook -p 9009 -s public

info @storybook/react v6.1.11
info
info => Loading static files from C:\Users\ion.gonzalez\source\repos\E2E\E2ePor\Components\public and serving at /.
info => Loading presets
ERR! Addon value should end in /register OR it should be a valid preset https://storybook.js.org/docs/presets/introduction/
ERR! [object Object]
info => Loading presets
ERR! Addon value should end in /register OR it should be a valid preset https://storybook.js.org/docs/presets/introduction/
ERR! [object Object]
info => Loading custom babel config
info => Loading custom babel config
info => Loading 4 other files in "./.storybook"
info => Adding stories defined in ".storybook\main.js"
info => Loading Webpack configuration from node_modules\react-scripts
info => Removing existing JavaScript and TypeScript rules.
info => Modifying Create React App rules.
info => Using default Webpack setup
`
https://storybook.js.org/docs/presets/introduction/ doesn't work anymore

and adding /register results me on

Failed to load preset: {"name":"@storybook-addon-designs/register"} on level 1

So, can anyone give me some light here? (much appreciated)

Error: Cannot find module '@storybook-addon-designs/register'

main.js

module.exports = {
  stories: ['../src/**/*.stories.@(js|mdx)'],
  addons: [
    { name: '@storybook/preset-typescript' },
    { name: "@storybook/preset-create-react-app", options: { tsDocgenLoaderOptions: {} }},
    { name: '@storybook/addon-links' },
    { name: '@storybook/addon-docs', options: { configureJSX: true }},
    { name: '@storybook/addon-knobs' },
    { name: '@storybook/addon-viewport' },
    { name: '@storybook-addon-designs' }
  ],
};
@pocka
Copy link
Collaborator

pocka commented Dec 17, 2020

Storybook tries to find a package named @storybook-addon-design and throws a not found error.

- { name: '@storybook-addon-designs' }
+ { name: 'storybook-addon-designs' }

The leading @ is a package scope symbol. So, for example, @storybook/addon-docs means "addon-docs package in a @storybook scope".

Since this addon is not a scoped package, you don't need the one :)

@pocka pocka closed this as completed Dec 17, 2020
@pocka pocka added the category: question Further information is requested label Dec 17, 2020
@suzzlo
Copy link
Author

suzzlo commented Dec 17, 2020

You make my day!

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants