Current Behavior
babel-preset-minify
Cannot read property 'isIfStatement' of null
Input Code
https://github.com/eeve/test.v2
// module-a.js
export default function () {
return 1;
}
Babel Configuration (.babelrc, package.json, cli command)
{
"presets": [
[
"@babel/preset-env",
{
"debug": true,
"useBuiltIns": "usage",
"targets": {
"node": 6
}
}
],
"minify"
],
"sourceMaps": "inline"
}
Environment
cliAdditional context/Screenshots

This is fixed in #848.
You can try the master branch by installing the canary version - https://github.com/babel/minify/tree/master/docs#canary-version ..
I'm closing this issue now. If the issue still persists in the canary version, please comment here to reopen the issue.
this problem still exists in this module "babel-plugin-minify-constant-folding": "^0.4.3"

Any news on this? I get the same error with "babel-plugin-minify-constant-folding": "^0.4.3"
edit: worked with yarn add babel-preset-minify@canary
Still the same issue for me. Please re-open.
Cannot read property 'isIfStatement' of null
at evaluateBasedOnControlFlow (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/babel-helper-evaluate-path/lib/index.js:159:32)
at evaluateIdentifier (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/babel-helper-evaluate-path/lib/index.js:117:26)
at evaluate (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/babel-helper-evaluate-path/lib/index.js:19:12)
at PluginPass.Expression (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/babel-plugin-minify-constant-folding/lib/index.js:165:21
)
at PluginPass.newFn (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/visitors.js:230:17)
at newFn (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/swerner/Workspace/init/init-stopnet-display/node_modules/@babel/traverse/lib/context.js:118:16)
Had this issue with build, and can confirm working with:
yarn add babel-preset-minify@canary
babel-preset-minify@canary works in my case as well
When will this be fixed on the main branch?
Considering that the canary release is 0.5.0-beta.54, probably when 0.5.0 is released.
Same bug on last release, with canary all work fine
Am also experiencing this, can confirm it's been fixed on the canary
Most helpful comment
When will this be fixed on the main branch?