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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TypeError: Cannot read properties of undefined (reading 'constantViolations') #15300

Closed
1 task
cervotoc opened this issue Dec 22, 2022 · 9 comments 路 Fixed by #15301
Closed
1 task

[Bug]: TypeError: Cannot read properties of undefined (reading 'constantViolations') #15300

cervotoc opened this issue Dec 22, 2022 · 9 comments 路 Fixed by #15301
Labels
i: bug i: regression Needs Info outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@cervotoc
Copy link

馃捇

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

image

Configuration file name

No response

Configuration

No response

Current and expected behavior

After release @babel/plugin-transform-block-scoping v7.20.7 have problem with build project. When override devDependencies to v7.20.5 build works fine.

Environment

  • @babel/plugin-transform-block-scoping v7.20.7

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @cervotoc! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@babel-bot
Copy link
Collaborator

Hi @cervotoc! This issue is missing some important information we'll need to be able to reproduce this issue.

Please understand that we receive a high volume of issues, and there are only a limited number of volunteers that help maintain this project. The easier it is for us to decipher an issue with the info provided, the more likely it is that we'll be able to help.

Please make sure you have the following information documented in this ticket:

  1. Your Babel configuration (typically from .babelrc or babel.config.js)
  2. The current (incorrect) behavior you're seeing
  3. The behavior you expect
  4. A short, self-contained example

Please provide either a link to the problem via the repl, or if the repl is insufficient, a new and minimal repository with instructions on how to build/replicate the issue.

@ndelangen
Copy link

@timhuijgen
Copy link

We also have multiple Angular projects running into the same issue.

@ndelangen
Copy link

Looking at https://github.com/babel/babel/releases it would appear as if this PR might be the only thing that changed:
#15278 ?

But of course it could be that somewhere else in the call stack things changed..

Here's the full stack trace of 1 error we get:

ERR! Module build failed (from ./node_modules/babel-loader/lib/index.js):
ERR! TypeError: /tmp/storybook/bench/cra-default-ts/.storybook/preview.js: Cannot read properties of undefined (reading 'constantViolations')
ERR!     at disallowConstantViolations (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/validation.js:23:35)
ERR!     at validateUsage (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/validation.js:17:7)
ERR!     at transformBlockScopedVariable (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:123:57)
ERR!     at PluginPass.VariableDeclaration (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:83:11)
ERR!     at newFn (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/visitors.js:156:21)
ERR!     at NodePath._call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:49:20)
ERR!     at NodePath.call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:36:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:86:31)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:92:52)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at traverse (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/index.js:50:34)
ERR!     at transformFile (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:81:29)
ERR!     at transformFile.next (<anonymous>)
ERR!     at run (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:24:12)
ERR!     at run.next (<anonymous>)
ERR!     at transform (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transform.js:23:41)
ERR!     at transform.next (<anonymous>)
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:221:32)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:159:13
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/gensync-utils/async.js:96:7
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:97:35
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:238:14)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)

@ndelangen
Copy link

This is another PR that touched the code in this release:
#15275

@ndelangen
Copy link

Ow, this one seems a candidate: #15200

@ndelangen
Copy link

ndelangen commented Dec 22, 2022

@nicolo-ribaudo It seems this issue isn't quite resolved..

Would you mind re-opening the issue, or @cervotoc?

It might be related to browserlist somehow, I've heard 1 storybook user report:

I could replicate the issue by removing the browserslist from the package.json file. Adding it back resolved the issue.
~ storybookjs/storybook#20382 (comment)

But right now this is the error storybook users are facing:

ERR! TypeError: /tmp/storybook/bench/cra-default-ts/.storybook/preview.js: Cannot set properties of undefined (setting 'kind')
ERR!     at transformBlockScopedVariable (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:127:41)

full:

ERR! TypeError: /tmp/storybook/bench/cra-default-ts/.storybook/preview.js: Cannot set properties of undefined (setting 'kind')
ERR!     at transformBlockScopedVariable (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:127:41)
ERR!     at PluginPass.VariableDeclaration (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:83:11)
ERR!     at newFn (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/visitors.js:156:21)
ERR!     at NodePath._call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:49:20)
ERR!     at NodePath.call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:36:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:86:31)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:92:52)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at traverse (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/index.js:50:34)
ERR!     at transformFile (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:81:29)
ERR!     at transformFile.next (<anonymous>)
ERR!     at run (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:24:12)
ERR!     at run.next (<anonymous>)
ERR!     at transform (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transform.js:23:41)
ERR!     at transform.next (<anonymous>)
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:221:32)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:159:13
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/gensync-utils/async.js:96:7
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:97:35
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:238:14)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)

@cervotoc
Copy link
Author

@nicolo-ribaudo It seems this issue isn't quite resolved..

Would you mind re-opening the issue, or @cervotoc?

It might be related to browserlist somehow, I've heard 1 storybook user report:

I could replicate the issue by removing the browserslist from the package.json file. Adding it back resolved the issue.
~ storybookjs/storybook#20382 (comment)

But right now this is the error storybook users are facing:

ERR! TypeError: /tmp/storybook/bench/cra-default-ts/.storybook/preview.js: Cannot set properties of undefined (setting 'kind')
ERR!     at transformBlockScopedVariable (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:127:41)

full:

ERR! TypeError: /tmp/storybook/bench/cra-default-ts/.storybook/preview.js: Cannot set properties of undefined (setting 'kind')
ERR!     at transformBlockScopedVariable (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:127:41)
ERR!     at PluginPass.VariableDeclaration (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:83:11)
ERR!     at newFn (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/visitors.js:156:21)
ERR!     at NodePath._call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:49:20)
ERR!     at NodePath.call (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:36:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:86:31)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at NodePath.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/path/context.js:92:52)
ERR!     at TraversalContext.visitQueue (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:95:16)
ERR!     at TraversalContext.visitSingle (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:71:19)
ERR!     at TraversalContext.visit (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/context.js:120:19)
ERR!     at traverseNode (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/traverse-node.js:20:17)
ERR!     at traverse (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/traverse/lib/index.js:50:34)
ERR!     at transformFile (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:81:29)
ERR!     at transformFile.next (<anonymous>)
ERR!     at run (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transformation/index.js:24:12)
ERR!     at run.next (<anonymous>)
ERR!     at transform (/tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/transform.js:23:41)
ERR!     at transform.next (<anonymous>)
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:221:32)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:159:13
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/@babel/core/lib/gensync-utils/async.js:96:7
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:97:35
ERR!     at step (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:238:14)
ERR!     at /tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:229:13
ERR!     at async.call.result.err.err (/tmp/storybook/bench/cra-default-ts/node_modules/gensync/index.js:190:11)

i dont know how re-open this issue :\ but i want - the solution not work

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: regression Needs Info outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants