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

Issue with brand new Vue app (created to test storybook) #4065

Closed
mikeerickson opened this issue Aug 23, 2018 · 15 comments
Closed

Issue with brand new Vue app (created to test storybook) #4065

mikeerickson opened this issue Aug 23, 2018 · 15 comments

Comments

@mikeerickson
Copy link

mikeerickson commented Aug 23, 2018

If you are reporting a bug or requesting support, start here:

Bug or support request summary

I have performed the following

> npm i -g @storybook/cli
> vue init webpack vue-storybook <--- using vue-cli 3.0.1
> yarn run storybook

Steps to reproduce

> yarn run storybook

WARNING in ./src/stories/index.stories.js
Module build failed: TypeError: /Users/mikee/Documents/code/js/vue/vue-storybook/src/stories/index.stories.js: Duplicate declaration "h" (This is an error on an internal node. Probably an internal error)
    at File.buildCodeFrameError (/Users/mikee/Documents/code/js/vue/vue-storybook/node_modules/babel-core/lib/transformation/file/index.js:427:15)

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/vue

Affected platforms

Issue is running on macOS 10.12.6 (error on startup)

image

image

@mikeerickson mikeerickson changed the title Issue with brand new vue app (created to test storybook) Issue with brand new Vue app (created to test storybook) Aug 23, 2018
@igor-dv
Copy link
Member

igor-dv commented Aug 28, 2018

You should use @storybook/cli@alpha

@mikeerickson
Copy link
Author

Thanks I will give it a try this evening

@orbjet
Copy link

orbjet commented Aug 30, 2018

This does not work at all. Following the guide for Vue I get the same error :(

@igor-dv
Copy link
Member

igor-dv commented Aug 30, 2018

@pksunkara, anything you can suggest?

@pksunkara
Copy link
Member

It's a babel transform error. He's using https://github.com/vuejs-templates/webpack and I guess storybook 3.8

@ram33
Copy link

ram33 commented Sep 6, 2018

I am facing the same issue... we built the app with vue-cli-3.0.0-rc3... any workaround?

@pksunkara
Copy link
Member

What storybook version are you guys using?

@ram33
Copy link

ram33 commented Sep 6, 2018

@pksunkara I have just tried with 4.0.0-alpha.20 getting below error when running 'getstorybook' itself

image

Earlier I tried with cli@4.0.0-alpha.15... that failed when running storybook with some babel-loader issue

@pksunkara
Copy link
Member

We will look into it, but please use https://github.com/storybooks/vue-cli-plugin-storybook for vue-cli apps

@ram33
Copy link

ram33 commented Sep 6, 2018

@pksunkara that worked. Thank you.

@kyleoliveiro
Copy link

@pksunkara I'm using vue-cli-plugin-storybook with a fresh Vue app, but running into a different error. Seems like an issue with Babel:

Steps to reproduce:

Using @vue/cli@3.0.1, vue-cli-plugin-storybook@0.4.7.

  1. vue create myapp
  2. Select default preset
  3. vue add storybook, select "Initial framework"
  4. yarn serve:storybook => Output below
info
info => Loading presetsinfo => Loading custom addons config.
info => Using default webpack setup.
 10% building modules 2/2 modules 0 activeℹ 「wdm」: wait until bundle finished:
webpack built ac4a53e2d1911e62d354 in 4824ms
⚠ 「wdm」: Hash: ac4a53e2d1911e62d354
Version: webpack 4.17.2Time: 4824ms
Built at: 2018-09-10 10:43:12                       Asset       Size   Chunks                    Chunk Names
     static/iframe.bundle.js   1.05 MiB   iframe  [emitted]  [big]  iframe    static/manager.bundle.js   3.01 MiB  manager  [emitted]  [big]  manager
                 iframe.html   2.26 KiB           [emitted]                  index.html  859 bytes           [emitted]
 static/iframe.bundle.js.map   1.06 MiB   iframe  [emitted]         iframe
static/manager.bundle.js.map    3.2 MiB  manager  [emitted]         manager
Entrypoint iframe [big] = static/iframe.bundle.js static/iframe.bundle.js.map
Entrypoint manager [big] = static/manager.bundle.js static/manager.bundle.js.map
[./config/storybook/addons.js] 105 bytes {manager} [built]
[./config/storybook/config.js] 508 bytes {iframe} [built]
[./node_modules/@storybook/core/dist/client/manager/index.js] 366 bytes {manager} [built]
[./node_modules/@storybook/core/dist/server/config/globals.js] 93 bytes {iframe} [built]
[./node_modules/@storybook/core/dist/server/config/polyfills.js] 113 bytes {iframe} {manager} [built]
[./node_modules/core-js/fn/array/iterator.js] 107 bytes {iframe} {manager} [built]
[./node_modules/core-js/modules/web.dom.iterable.js] 1.77 KiB {iframe} [built]
[./node_modules/querystring-es3/index.js] 127 bytes {iframe} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {iframe} [built]
[./node_modules/webpack-hot-middleware/client-overlay.js] (webpack)-hot-middleware/client-overlay.js 2.16 KiB {iframe} [built]
[./node_modules/webpack-hot-middleware/client.js?reload=true] (webpack)-hot-middleware/client.js?reload=true 7.59 KiB {iframe} [built]
[./node_modules/webpack-hot-middleware/process-update.js] (webpack)-hot-middleware/process-update.js 4.23 KiB {iframe} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {iframe} {manager} [built]
[0] multi ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/server/config/globals.js ./config/storybook/config.js (webpack)-hot-middleware/client.js?reload=true 64 bytes {iframe} [built]
[1] multi ./config/storybook/addons.js ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/client/manager/index.js 52 bytes {manager} [built]
    + 874 hidden modules

WARNING in ./src/stories/index.stories.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: programPath.hub.addHelper is not a function
    at wrapInterop (/PROJECT_PATH/node_modules/@babel/helper-module-transforms/lib/index.js:165:45)
    at PluginPass.exit (/PROJECT_PATH/node_modules/@storybook/core/node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js:174:70)
    at newFn (/PROJECT_PATH/node_modules/@babel/traverse/lib/visitors.js:237:21)
    at NodePath._call (/PROJECT_PATH/node_modules/@babel/traverse/lib/path/context.js:65:20)
    at NodePath.call (/PROJECT_PATH/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/PROJECT_PATH/node_modules/@babel/traverse/lib/path/context.js:109:8)
    at TraversalContext.visitQueue (/PROJECT_PATH/node_modules/@babel/traverse/lib/context.js:142:16)
    at TraversalContext.visitSingle (/PROJECT_PATH/node_modules/@babel/traverse/lib/context.js:102:19)
    at TraversalContext.visit (/PROJECT_PATH/node_modules/@babel/traverse/lib/context.js:182:19)
    at Function.traverse.node (/PROJECT_PATH/node_modules/@babel/traverse/lib/index.js:106:17)
    at traverse (/PROJECT_PATH/node_modules/@babel/traverse/lib/index.js:76:12)
    at transformFile (/PROJECT_PATH/node_modules/@babel/core/lib/transformation/index.js:116:29)
    at runSync (/PROJECT_PATH/node_modules/@babel/core/lib/transformation/index.js:45:3)
    at runAsync (/PROJECT_PATH/node_modules/@babel/core/lib/transformation/index.js:35:14)
    at process.nextTick (/PROJECT_PATH/node_modules/@babel/core/lib/transform.js:34:34)
    at process._tickCallback (internal/process/next_tick.js:112:11)
 @ ./src/stories sync .stories.js$ ./index.stories.js
 @ ./config/storybook/config.js
 @ multi ./node_modules/@storybook/core/dist/server/config/polyfills.js ./node_modules/@storybook/core/dist/server/config/globals.js ./config/storybook/config.js (webpack)-hot-middleware/client.js?reload=true
ℹ 「wdm」: Compiled with warnings.
info Storybook started on => http://localhost:6006/
info

[0] 0:node*Z                                                                                      "yarn serve:storybook" 10:51 10-Sep-18

@pksunkara
Copy link
Member

It's probably because of alpha.21. I need to change the plugin a bit because of that new release.

@pksunkara
Copy link
Member

Continuing the conversation in storybookjs/vue-cli-plugin-storybook#22

@stale
Copy link

stale bot commented Oct 1, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@towry
Copy link

towry commented Jun 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants