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

Version 4.34.0 introduced bug parsing slots in VUE 2.x which breaks storybook docs. #1027

Closed
piscis opened this issue Nov 26, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@piscis
Copy link

piscis commented Nov 26, 2020

Current behavior

After upgrading our lock file we received lot of warnings while running storybook build.

Currently we're using Storybook 6.1.6 + VUE.JS (2.x).

Console output

Module Warning (from /home/runner/work/fooproject/node_modules/vue-docgen-loader/lib/index.js):
[vue-docgen-loader] failed to parse the component file with docgen-api: Cannot read property 'leadingComments' of null

 @ ./src/stories/frontend/forms/FormDummyLogin.stories.js 66:0-76 70:13-27 91:17-31
 @ ./src sync ^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(js|jsx|ts|tsx|mdx))$
 @ ./config/storybook/generated-stories-entry.js
 @ multi /home/runner/work/fooproject/node_modules/@storybook/core/dist/server/common/polyfills.js /home/runner/work/fooproject/node_modules/@storybook/core/dist/server/preview/globals.js ./config/storybook/storybook-init-framework-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-docs/dist/frameworks/vue/config.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-backgrounds/dist/preset/addDecorator.js-generated-other-entry.js /home/runner/work/fooproject/node_modules/@storybook/addon-backgrounds/dist/preset/addParameter.js-generated-other-entry.js ./config/storybook/preview.js-generated-config-entry.js ./config/storybook/generated-stories-entry.js

Current dependency from storybook in yarn.lock

....
"@storybook/vue@6.1.6":
  version "6.1.6"
  dependencies:
    "@storybook/addons" "6.1.6"
    "@storybook/core" "6.1.6"
    "@types/webpack-env" "^1.15.3"
    core-js "^3.0.1"
    global "^4.3.2"
    react "16.13.1"
    react-dom "16.13.1"
    regenerator-runtime "^0.13.7"
    ts-dedent "^2.0.0"
    ts-loader "^6.2.2"
    vue-docgen-api "^4.33.1"
    vue-docgen-loader "^1.5.0"
    webpack "^4.44.2"
....

One side effect is that you're storybook is building with the errors and that a storybook:build is missing our stylesheets. The Docs Tab is also broken and the props and event tabs under control are missing.

To reproduce

Sorry I don't have a demo repo, I can show right now but I tracked the error down. Since we're updateing the lock on a daily base I realized that 4.34.0 contains a fix for slots

https://github.com/vue-styleguidist/vue-styleguidist/releases/tag/v4.34.0

If I pin vue-docgen-api to 4.33.9 via resolutions in our yarn file it stops emitting this warning.

Expected behavior

It should build without warnings and show props and events in Doc Tabs and controls.

Workaround for now

Pin vue-docgen-api to 4.33.9 via yarn resolutions.

...
"resolutions": {
    "**/vue-docgen-api": "4.33.9"
  }
...
@elevatebart elevatebart added the bug Something isn't working label Nov 27, 2020
@elevatebart elevatebart added this to todo in vue-docgen-api via automation Nov 27, 2020
@elevatebart
Copy link
Member

Alright, I am on it. Sry for the inconvenience.

This was referenced Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants