Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

storybook@^6.2.0 release breaks @nuxtjs/storybook #252

Closed
lihbr opened this issue Mar 30, 2021 · 8 comments
Closed

storybook@^6.2.0 release breaks @nuxtjs/storybook #252

lihbr opened this issue Mar 30, 2021 · 8 comments
Labels
type: bug Something isn't working

Comments

@lihbr
Copy link

lihbr commented Mar 30, 2021

Hey! Basically Storybook released a minor that breaks the module. I'm sorry for not submitting a really comprehensive issue, I'm a bit in a hurry right now, hit me up if anything!

Version

@nuxtjs/storybook: v3.3.1
nuxt: v2.15.3

node: v14.15.3
npm: v6.14.9
yarn: v1.22.10

Reproduction Link

N/A

Steps to reproduce

  1. Create a Nuxt.js application: npx create-nuxt-app repro-252
  2. Get into it: cd repro-252
  3. Install the Storybook module: yarn add --dev @nuxtjs/storybook (or: npm install --save-dev @nuxtjs/storybook
  4. Launch Storybook: npx nuxt storybook

What is Expected?

@nuxtjs/storybook should be working.

What is actually happening?

lihbr@mbp-lucie test-storybook % yarn nuxt storybook
yarn run v1.22.10
$ /Users/lihbr/Desktop/test-storybook/node_modules/.bin/nuxt storybook
 WARN  postcss@8.2.8 is installed but ^7.0.32 is expected       21:33:52
internal/modules/cjs/loader.js:969
 throw err;
 ^
Error: Cannot find module ‘@storybook/vue/dist/server/options’
Require stack:
- /Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/dist/index.js
- /Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/dist/cli.js
- /Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/bin/nuxt-storybook.js
  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
  at Function.Module._load (internal/modules/cjs/loader.js:842:27)
  at Module.require (internal/modules/cjs/loader.js:1026:19)
  at require (internal/modules/cjs/helpers.js:72:18)
  at Object.<anonymous> (/Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/dist/index.js:19:35)
  at Module._compile (internal/modules/cjs/loader.js:1138:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
  at Module.load (internal/modules/cjs/loader.js:986:32)
  at Function.Module._load (internal/modules/cjs/loader.js:879:14)
  at Module.require (internal/modules/cjs/loader.js:1026:19) {
 code: ‘MODULE_NOT_FOUND’,
 requireStack: [
  ‘/Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/dist/index.js’,
  ‘/Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/dist/cli.js’,
  ‘/Users/lihbr/Desktop/test-storybook/node_modules/@nuxtjs/storybook/bin/nuxt-storybook.js’
 ]
}
 FATAL  Failed to run command nuxt-storybook:             21:33:52
Error: Command failed with exit code 1: nuxt-storybook
  ╭────────────────────────────────────────────────────────────╮
  │                                                            │
  │  :heavy_multiplication_x: Nuxt Fatal Error                 │
  │                                                            │
  │  Failed to run command `nuxt-storybook`:                   │
  │  Error: Command failed with exit code 1: nuxt-storybook    │
  │                                                            │
  ╰────────────────────────────────────────────────────────────╯
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Workaround

For anyone experiencing the same issue, in the meantime you should be able to fix it this way:

  1. Install explicitly @storybook/vue@6.1.21 (and pin other addons to the same version) in your package.json
  2. Install vue-loader@15.9.6 to dev dependencies.

Anything else

I tested on Windows and MacOS and ended up with the same output.

Since Storybook doesn't seem to commit to SemVer fully perhaps we should use the tilde range instead of the caret one for referencing its dependencies? This will prevent the module to break on its own every now and then?

cc @arnaudlewis

@lihbr lihbr added the type: bug Something isn't working label Mar 30, 2021
@lihbr lihbr changed the title storybook@^6.2.0 releases breaks @nuxtjs/storybbok storybook@^6.2.0 release breaks @nuxtjs/storybbok Mar 30, 2021
@lihbr lihbr changed the title storybook@^6.2.0 release breaks @nuxtjs/storybbok storybook@^6.2.0 release breaks @nuxtjs/storybook Mar 30, 2021
@javiertoledos
Copy link

javiertoledos commented Mar 31, 2021

I confirm @lihbr workaround works.

@vaban-ru
Copy link

vaban-ru commented Mar 31, 2021

Confirm
image

@scoutrul
Copy link

Have the same since yesterday ;((

@farnabaz
Copy link
Collaborator

farnabaz commented Apr 1, 2021

This will fix in v3.4.

@lihbr
Copy link
Author

lihbr commented Apr 1, 2021

Thanks for the heads up @farnabaz, can we consider that one?

Since Storybook doesn't seem to commit to SemVer fully perhaps we should use the tilde range instead of the caret one for referencing its dependencies? This will prevent the module to break on its own every now and then?

@lihbr
Copy link
Author

lihbr commented Apr 12, 2021

I guess this has been fixed with version 4?

@farnabaz do you want to publish a patch for version 3 users that aren't yet on Nuxt 2.15.3+ or is it "good enough" to tell them to rely on the aforementioned workaround? Let me know, happy to help on a PR!

For anyone experiencing the same issue, in the meantime you should be able to fix it this way:

  • Install explicitly @storybook/vue@6.1.21 (and pin other addons to the same version) in your package.json
  • Install vue-loader@15.9.6 to dev dependencies.

Copy link
Collaborator

It's good idea to release a patch for v3 users @lihbr
Contribution is more than welcome 🙂

@lihbr lihbr mentioned this issue Apr 12, 2021
6 tasks
@lihbr
Copy link
Author

lihbr commented Apr 12, 2021

Cheers~ #260

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants