-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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]: Cannot read properties of undefined (reading 'addHelper') #15752
Comments
Hey @ethanyou725! 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. |
With the recent release we also received similar reports in Angular CLI for The issue appears to happen when having multiple I am still trying to work out a minimal reproduction. |
same question. |
Working on it :) (investigating) |
As a workaround, try using |
We are facing the same issue. Downgrading to previous version worked! |
same issue |
Overriding @babel/traverser to last version worked for us |
it works, thanks |
I have not found the cause of the bug yet, but #15754 should probably make it away until when I figure out how to properly fix it. |
The problem lies in the dependency tree, likely in preset env which is not pinning some sub dependencies and using a range resulting in some mismatched versions of the babel plugins, so basically you have for instance the I think the solution is to mark in the |
I'm releasing version 7.22.8 of |
Thank you @nicolo-ribaudo. |
@Tofandel That shouldn't cause problems. In the angular issue linked above, there is only one version of |
Well I had the error and then when I upgraded all the babel packages, no more error So I'd like to see an |
Thank you! |
We are facing the same issue while using react-scripts. Does anyone know how to freeze the whole dependency tree using npm so that the builds are reproducible and such issues don't make it into production? |
Use a |
Beat me to it, it's good practice to do that in every project so that you only upgrade deps on production once they have been tested and released, this will prevent you supply chain attacks and headaches with broken deps |
Can anyone still reproduce the problem with If you can still reproduce the issue using those versions, could you share a repository (even if not minimal) I can use to reproduce it? |
I can confirm that the issue on angular has been fix with the update 馃憤 Thank you @nicolo-ribaudo for the swift fix ! |
Hi @nicolo-ribaudo,
|
For the source of the issue it's indeed to have 2 In my case though it's a problem with yarn and renovate creating a split deps when it's not needed resulting in the following yarn.lock"@babel/core@7.22.7": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.7.tgz#b0a766ebdb776d83981a221d90b2db887b870659" integrity sha512-exABdCVjEk8+IFJW0gOK6+cou8VKMXfbkLGeK5Xdsa5MsuQmem1SsnnZ+6avm2gRhZ4M7UgAnE6YoAzVg9P/pw== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.7" "@babel/helper-compilation-targets" "^7.22.6" "@babel/helper-module-transforms" "^7.22.5" "@babel/helpers" "^7.22.6" "@babel/parser" "^7.22.7" "@babel/template" "^7.22.5" "@babel/traverse" "^7.22.7" "@babel/types" "^7.22.5" "@nicolo-ribaudo/semver-v6" "^6.3.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" "@babel/core@^7.12.16", "@babel/core@^7.15.8": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.21.4" "@babel/generator" "^7.21.4" "@babel/helper-compilation-targets" "^7.21.4" "@babel/helper-module-transforms" "^7.21.2" "@babel/helpers" "^7.21.0" "@babel/parser" "^7.21.4" "@babel/template" "^7.20.7" "@babel/traverse" "^7.21.4" "@babel/types" "^7.21.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" semver "^6.3.0" "@babel/traverse@^7.0.0", "@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== dependencies: "@babel/code-frame" "^7.21.4" "@babel/generator" "^7.21.4" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/parser" "^7.21.4" "@babel/types" "^7.21.4" debug "^4.1.0" globals "^11.1.0" "@babel/traverse@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.5.tgz#44bd276690db6f4940fdb84e1cb4abd2f729ccd1" integrity sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ== dependencies: "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.5" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.5" "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" "@babel/traverse@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.6.tgz#8f2f83a5c588251584914debeee38f35f661a300" integrity sha512-53CijMvKlLIDlOTrdWiHileRddlIiwUIyCKqYa7lYnnPldXCG5dUSN38uT0cA6i7rHWNKJLH0VU/Kxdr1GzB3w== dependencies: "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.5" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" "@babel/parser" "^7.22.6" "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" "@babel/traverse@^7.22.7": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.7.tgz#68a5513f3c6b88c7b5f5825d0720fb43e8a31826" integrity sha512-vQn61YQzktf1wFNzCka2dynnnbmBpUDeUCds3Y+FBHZpcVxpBq0XscQGDDVN7sV2Vf1pZDY1HmPR3U/5t7VfMQ== dependencies: "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.7" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" "@babel/parser" "^7.22.7" "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" This is really a messy yarn.lock, so I forced a rebuild using `yarn upgrade` which now merged the deps"@babel/core@7.22.7", "@babel/core@^7.12.16", "@babel/core@^7.15.8", "@babel/core@^7.20.2": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.7.tgz#b0a766ebdb776d83981a221d90b2db887b870659" integrity sha512-exABdCVjEk8+IFJW0gOK6+cou8VKMXfbkLGeK5Xdsa5MsuQmem1SsnnZ+6avm2gRhZ4M7UgAnE6YoAzVg9P/pw== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.7" "@babel/helper-compilation-targets" "^7.22.6" "@babel/helper-module-transforms" "^7.22.5" "@babel/helpers" "^7.22.6" "@babel/parser" "^7.22.7" "@babel/template" "^7.22.5" "@babel/traverse" "^7.22.7" "@babel/types" "^7.22.5" "@nicolo-ribaudo/semver-v6" "^6.3.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" "@babel/traverse@^7.20.1", "@babel/traverse@^7.22.5", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.7": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.7.tgz#68a5513f3c6b88c7b5f5825d0720fb43e8a31826" integrity sha512-vQn61YQzktf1wFNzCka2dynnnbmBpUDeUCds3Y+FBHZpcVxpBq0XscQGDDVN7sV2Vf1pZDY1HmPR3U/5t7VfMQ== dependencies: "@babel/code-frame" "^7.22.5" "@babel/generator" "^7.22.7" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" "@babel/parser" "^7.22.7" "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" Which fixed the issue |
@nicolo-ribaudo |
@riddhi-24 Can you make sure that your lockfile does not contain |
Yes, actually I've removed @babel/core & tried everything seems working as expected |
I had the same issue, and after upgrading babel to version 7.22.8, I have now another issue |
On everybody affected by the issue, are any of you using Here is a bug I've noticed with yarn when pinning dependencies and running |
I tracked down the cause of the bug to using |
Thanks @nicolo-ribaudo. Build was passed with new version |
Thanks @nicolo-ribaudo Yesterday I faced same issue while production deployment. With the latest version it seems to be working fine now |
|
Could you share your package.json, Babel config, and lockfile? |
I narrowed it down to "@react-native/metro-config": "^0.72.11", being upgraded to ^0.73.0 in my package.json, but that is still a nightly so we can ignore this for now. This happened because I used npm-check-updates with |
I can back up what @mendrixsebas is saying -- I had to do the following because I use yarn though
|
error src\view\LegenImage.tsx: D:\DEV\eb_app\src\view\LegenImage.tsx: Cannot read properties of undefined (reading 'addHelper'). Same issue for |
I had to install to version 0.72.5 to resolve this issue. |
"resolutions": { this not work for me |
馃捇
How are you using Babel?
babel-loader (webpack)
Input code
part of package.json
Configuration file name
No response
Configuration
babel.config.json
Current and expected behavior
I think it's a bug of latest published version, project is built on remote CI server,
about an hour ago, we got an error on
npm install
because internal npm mirror server did not sync the latest version
but after the server synced, we got another error on
npm build
via webpackEnvironment
cannot reproduce on local machine, the error is on CI server.
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: