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

build-storybook fails with 'Cannot set property inList' under Babel 7.6 #8743

Closed
csvan opened this issue Nov 6, 2019 · 8 comments
Closed

Comments

@csvan
Copy link

csvan commented Nov 6, 2019

Describe the bug

Trying to run build-storybook under webpack 4.41 and babel 7.6 fails with the following:

csvanefalk@SEGOTA0184 ~/I/pros-customer-portal-ui-components> build-storybook 
info @storybook/react v5.2.5
info 
info clean outputDir..
info => Copying prebuild dll's..
info => Building manager..
info => Loading manager config..
info => Loading presets
info => Loading custom addons config.
info => Compiling manager..
ERR! => Failed to build the manager
ERR! ./addons/jsx/jsx-panel.js
ERR! Module build failed (from ./node_modules/babel-loader/lib/index.js):
ERR! TypeError: /Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/addons/jsx/jsx-panel.js: Cannot set property inList of [object Object] which has only a getter
ERR!     at PluginPass.exit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/babel-plugin-minify-simplify/lib/index.js:549:40)
ERR!     at newFn (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/visitors.js:179:21)
ERR!     at NodePath._call (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/path/context.js:55:20)
ERR!     at NodePath.call (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/path/context.js:42:17)
ERR!     at NodePath.visit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/path/context.js:99:8)
ERR!     at TraversalContext.visitQueue (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:112:16)
ERR!     at TraversalContext.visitSingle (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:84:19)
ERR!     at TraversalContext.visit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:140:19)
ERR!     at Function.traverse.node (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/index.js:84:17)
ERR!     at NodePath.visit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/path/context.js:97:18)
ERR!     at TraversalContext.visitQueue (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:112:16)
ERR!     at TraversalContext.visitMultiple (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:79:17)
ERR!     at TraversalContext.visit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:138:19)
ERR!     at Function.traverse.node (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/index.js:84:17)
ERR!     at NodePath.visit (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/path/context.js:97:18)
ERR!     at TraversalContext.visitQueue (/Users/csvanefalk/IdeaProjects/pros-customer-portal-ui-components/node_modules/@babel/traverse/lib/context.js:112:16)
ERR!  @ ./addons/jsx/register.js 1:193-215
ERR!  @ ./.storybook/addons.js
ERR!  @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./.storybook/addons.js ./node_modules/@storybook/core/dist/client/manager/index.js

To Reproduce
Steps to reproduce the behavior:
Make sure you have a clean local install, run `build-storybook

Expected behavior
Build should pass

Additional context

This exact build has worked fine up until approximately yesterday. The only major external change I have seen in that period is Babel releasing version 7.6, but it is difficult to find if this is failing due to that alone.

@csvan
Copy link
Author

csvan commented Nov 6, 2019

The problem is actually in the babel-plugin-minify-simplify plugin, which broke under Babel 7.6: babel/minify#967

@afebbraro
Copy link
Contributor

I'm getting this same issue, on @storybook/angular 5.3.0-alpha.40. I haven't check our React or HTML SBs yet.

"devDependencies": {
    "@angular-devkit/build-angular": "~0.802.2",
    "@angular-devkit/build-ng-packagr": "~0.802.2",
    "@angular/cli": "~8.2.2",
    "@angular/compiler-cli": "~8.2.0",
    "@angular/language-service": "~8.2.0",
    "@compodoc/compodoc": "^1.1.11",
    "@storybook/addon-a11y": "^5.3.0-alpha.40",
    "@storybook/addon-actions": "^5.3.0-alpha.40",
    "@storybook/addon-docs": "^5.3.0-alpha.40",
    "@storybook/addon-knobs": "^5.3.0-alpha.40",
    "@storybook/addons": "^5.3.0-alpha.40",
    "@storybook/angular": "^5.3.0-alpha.40",
    "@storybook/preset-scss": "^1.0.2",
    "@storybook/theming": "^5.3.0-alpha.40",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "babel-loader": "^8.0.6",
    "codelyzer": "^5.0.0",
    "css-loader": "^3.1.0",
    "eslint": "^6.5.1",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "ng-packagr": "^5.3.0",
    "node-sass": "^4.12.0",
    "protractor": "~5.4.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "ts-node": "~7.0.0",
    "tsickle": "^0.36.0",
    "tslint": "~5.15.0",
    "typescript": "~3.5.3"
  }

@shilman
Copy link
Member

shilman commented Nov 7, 2019

Please try this workaround from @aaronbarker: #8744 (comment)

@afebbraro
Copy link
Contributor

Thank you @shilman! npm i -D @babel/traverse@7.6.0 fixes it for me.

@matt-shine
Copy link

#8744 (comment)

@xlozinguez
Copy link

I think y'all mean 7.7, no?

@brendonco
Copy link

doesnt seem to work when npm i -D @babel/traverse@7.6.0. :(

@stale
Copy link

stale bot commented Dec 26, 2020

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!

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