Navigation Menu

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

fix: transform-block-scoping accesses properties of null #15301

Merged
merged 1 commit into from Dec 22, 2022

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Dec 22, 2022

Q                       A
Fixed Issues? Fixes #15300
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? ×
Documentation PR Link
Any Dependency Changes?
License MIT

I haven't actually reproduced this issue yet, due to the plethora of bug reports, this is a guesswork fix.

@liuxingbaoyu liuxingbaoyu added PR: Bug Fix 🐛 A type of pull request used for our changelog categories i: regression labels Dec 22, 2022
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53699/

@nicolo-ribaudo
Copy link
Member

@ndelangen Would you be able to copy-paste this fix in your node_modules and verify if it fixes the bug?

@nicolo-ribaudo
Copy link
Member

Oh well, I guess I can release once CI is green. For sure this change cannot cause problems.

@nicolo-ribaudo nicolo-ribaudo merged commit 1cbbbdd into babel:main Dec 22, 2022
@ndelangen
Copy link

@nicolo-ribaudo Sorry i was in a meeting, I'm going to upgrade and run Storybook Ecosystem CI, see what happens, will report back here ❤️ for the fast turn around, You all are awesome!

@ndelangen
Copy link

ndelangen commented Dec 22, 2022

@nicolo-ribaudo the Storybook Ecosystem CI runs a list of scripts that mimick wjhat users do when setting up new projects and adding storybook to that.. meaning it's not a manual process, we can really inject copy-pasted code into our node_modules into.

I noticed that https://www.npmjs.com/package/@babel/plugin-transform-block-scoping hasn't seen a new release (yet)?

I'm afraid I'm also not really able to pin the version of the package in our processes, because it's a transitive dependency, not a direct one.

Is a npm release scheduled to happen?
Is there a way for me to help out here?

@nicolo-ribaudo
Copy link
Member

I'm releasing now, it will be out in ~15 mins

@ndelangen
Copy link

@nicolo-ribaudo Running into a new issue:

ERR! Module build failed (from ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js):
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)

@Stephane-Ag
Copy link

Stephane-Ag commented Dec 22, 2022

I'm releasing now, it will be out in ~15 mins

@nicolo-ribaudo Do you know when the fix will be available on npm?

@ndelangen
Copy link

The fix that was reported initially has been released, but it seems another one has surfaced..

@thoussem
Copy link

Hello @nicolo-ribaudo,
I have the same issue with the newly released version @babel/plugin-transform-block-scoping@7.20.8 in an angular project (I can't build the app):

Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: /tmp/Downloads/webapp/node_modules/primeng/fesm2020/primeng-virtualscroller.mjs: Cannot set properties of undefined (setting 'kind')
    at transformBlockScopedVariable (/tmp/Downloads/webapp/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:122:41)
    at PluginPass.VariableDeclaration (/tmp/Downloads/webapp/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:81:9)
    at newFn (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/visitors.js:159:21)
    at NodePath._call (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/path/context.js:46:20)
    at NodePath.call (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/path/context.js:36:17)
    at NodePath.visit (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/path/context.js:84:31)
    at TraversalContext.visitQueue (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/context.js:96:16)
    at TraversalContext.visitSingle (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/context.js:72:19)
    at TraversalContext.visit (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/context.js:121:19)
    at traverseNode (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/traverse-node.js:18:17)
    at traverse (/tmp/Downloads/webapp/node_modules/@babel/traverse/lib/index.js:50:34)
    at transformFile (/tmp/Downloads/webapp/node_modules/@babel/core/lib/transformation/index.js:108:29)
    at transformFile.next (<anonymous>)
    at run (/tmp/Downloads/webapp/node_modules/@babel/core/lib/transformation/index.js:35:12)
    at run.next (<anonymous>)
    at Function.transform (/tmp/Downloads/webapp/node_modules/@babel/core/lib/transform.js:25:41)
ModuleBuildError: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
`

@Stephane-Ag
Copy link

Yeah. I had to manually downgrade @babel/plugin-transform-block-scoping to "7.20.5" and that seems to have fixed the issue for now.
Seems the source of this new issue is this commit.

@thoussem
Copy link

The issue is fixed with this patch @babel/plugin-transform-block-scoping@7.20.9
Thks.

@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 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError: Cannot read properties of undefined (reading 'constantViolations')
6 participants