-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform
, babel.parse
)
Input code
const isPrimitive = (value) => (value === null || (typeof value != 'object' && typeof value != 'function'));
Configuration file name
babel.config.json
Configuration
{
"presets": [
[
"@babel/preset-env",
{
"modules": "umd",
"targets": {
"chrome": "47"
}
}
]
]
}
Current and expected behavior
The code should be transformed without any errors.
Environment
It’s possible that this issue started with this PR #17031, as the transform-typeof-symbol
module was added in it.
- Binaries:
- Node: 22.13.0
- npm: 10.9.2
- npmPackages:
- @babel/cli: 7.26.4 => 7.26.4
- @babel/compat-data: 7.26.5 => 7.26.5
- @babel/core: 7.26.0 => 7.26.0
- @babel/preset-env: 7.26.0 => 7.26.0
- @babel/preset-typescript: 7.26.0 => 7.26.0
- babel-jest: 29.7.0 => 29.7.0
- babel-plugin-add-module-exports: 1.0.4 => 1.0.4
- babel-plugin-const-enum: 1.2.0 => 1.2.0
Possible solution
We are currently excluding transform-typeof-symbol
.
I think it might also be possible to fix the problem by adding @babel/plugin-transform-arrow-functions
for Chrome 47, but I’m not 100% sure if there are other issues or potential side effects from changing the Chrome version of the @babel/plugin-transform-arrow-functions
plugin.
Additional context
Error message:
/repl.js: Cannot read properties of undefined (reading '0')
Metadata
Metadata
Assignees
Labels
i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue