You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReferenceError: /Users/andy/gh/babel-plugin-istanbul-issue/index.js: Container is falsy
at NodePath._replaceWith (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/path/replacement.js:139:11)
at NodePath.replaceWith (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/path/replacement.js:127:8)
at wrapLoopBody (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/plugin-transform-block-scoping/lib/loop.js:162:43)
at PluginPass.Loop (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/plugin-transform-block-scoping/lib/index.js:82:50)
at newFn (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/visitors.js:160:14)
at NodePath._call (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/path/context.js:46:20)
at NodePath.call (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/path/context.js:36:17)
at NodePath.visit (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/path/context.js:82:31)
at TraversalContext.visitQueue (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/context.js:89:16)
at TraversalContext.visitMultiple (/Users/andy/gh/babel-plugin-istanbul-issue/node_modules/@babel/traverse/lib/context.js:61:17) {
code: 'BABEL_TRANSFORM_ERROR'
}
Environment
@babel/plugin-transform-block-scoping@7.23.4
@babel/cli@7.23.9
@babel/preset-env@7.24.0
babel-plugin-istanbul@6.1.1
Possible solution
No response
Additional context
I'm not sure if this is babel's fault or babel-plugin-istanbul's fault, but I'm linking istanbuljs/babel-plugin-istanbul#289 here in case the babel team has any ideas.
The parseInt(f) gets transformed into cov_1c743zp148().b[0][1]++, parseInt(f). But for some reason that expression is orphaned by the time @babel/plugin-transform-block-scoping tries to rename f to _f, causing an error to be thrown.
The text was updated successfully, but these errors were encountered:
Hey @jedwards1211! 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.
I think the fix will be better in istanbul. Fortunately, istanbul only has one visitor Program, so it only need to add path.scope.crawl(); to synchronize the new binding information to completely fix this problem.
馃捇
How are you using Babel?
@babel/cli
Input code
Configuration file name
.babelrc
Configuration
Current and expected behavior
expected to transpile successfully, but I get:
Environment
Possible solution
No response
Additional context
I'm not sure if this is babel's fault or
babel-plugin-istanbul
's fault, but I'm linking istanbuljs/babel-plugin-istanbul#289 here in case the babel team has any ideas.The
parseInt(f)
gets transformed intocov_1c743zp148().b[0][1]++, parseInt(f)
. But for some reason that expression is orphaned by the time@babel/plugin-transform-block-scoping
tries to renamef
to_f
, causing an error to be thrown.The text was updated successfully, but these errors were encountered: