-
-
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 property 'file' of undefined #15753
Comments
Hey @jisao! 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. |
Angular is also broken because of this issue. angular/angular-cli#25496 |
Can you still reproduce this issue with version 7.22.8 of |
It's fixed with babel version |
Using @bable/core version 7.22.8 can solve this problem |
It was not fixed for our use case. For some reason babel is behaving something like:
|
We were seeing this issue on 7.22.27 last night, but it appears to have been resolved by pulling 7.22.28 |
@mshima That looks like a different issue, since the error is thrown by the generated code and not while compiling. Could you open a new issue, with steps I can use to reproduce it? |
For me, manually installing @babel/traverse@7.22.6 is a potential workaround solution. My project 'luckily' has two versions of @babel/traverse, it was updated from 7.22.6 to 7.22.7. It was difficult to identify this problem because the bot released the package without any tags yesterday. |
馃捇
How are you using Babel?
babel-loader (webpack)
Input code
Configuration file name
.babelrc
Configuration
{
"presets": [["@babel/preset-env", { "modules": false, "useBuiltIns": "usage", "corejs": "3" }], "@babel/preset-react", "@babel/preset-typescript"],
"plugins": [
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }],
"@babel/transform-runtime",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
],
}
Current and expected behavior
ERROR in ./src/entry/index/index.js
Module build failed (from ./node_modules/happypack/loader.js):
TypeError: /Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/src/entry/index/index.js: Cannot read property 'file' of undefined
at Object.usagePure (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/babel-plugin-polyfill-regenerator/lib/index.js:35:48)
at callProvider (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/helper-define-polyfill-provider/lib/index.js:178:27)
at PluginPass.ReferencedIdentifier (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js:25:7)
at PluginPass.newFn (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/visitors.js:192:17)
at newFn (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/visitors.js:159:14)
at NodePath._call (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/path/context.js:46:20)
at NodePath.call (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/path/context.js:36:17)
at NodePath.visit (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/path/context.js:82:31)
at TraversalContext.visitQueue (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/context.js:86:16)
at TraversalContext.visitSingle (/Users/xiaoheshang/Desktop/his/his/hospitalization_doctor_station/node_modules/@babel/traverse/lib/context.js:65:19)
Environment
All projects started or packaged locally today with this issue
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: