Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Cannot read property 'isIfStatement' of null #850

Closed
eeve opened this issue May 16, 2018 · 11 comments
Closed

error: Cannot read property 'isIfStatement' of null #850

eeve opened this issue May 16, 2018 · 11 comments

Comments

@eeve
Copy link

eeve commented May 16, 2018

Bug Report

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

  • Babel version(s): v7.0.0-beta.47
  • Node/npm version: Node 8.9.4/npm 6.0.0
  • Monorepo: no
  • How you are using Babel: cli

Additional context/Screenshots
20180516111516.png

@Cyp
Copy link

Cyp commented May 16, 2018

This is fixed in #848.

@boopathi
Copy link
Member

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.

@webyonet
Copy link

this problem still exists in this module "babel-plugin-minify-constant-folding": "^0.4.3"

screen shot 2018-05-23 at 6 24 54 pm

@DeadIine
Copy link

DeadIine commented May 30, 2018

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

@swernerx
Copy link

swernerx commented Jun 4, 2018

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)

@SouperSudo
Copy link

Had this issue with build, and can confirm working with:
yarn add babel-preset-minify@canary

@NikaBuligini
Copy link

babel-preset-minify@canary works in my case as well

@ChrisWiles
Copy link

When will this be fixed on the main branch?

zGrav added a commit to bitchcraft/reactjs-boilerplate that referenced this issue Jul 9, 2018
@villasv
Copy link

villasv commented Jul 23, 2018

Considering that the canary release is 0.5.0-beta.54, probably when 0.5.0 is released.

@MitsuhaKitsune
Copy link

Same bug on last release, with canary all work fine

ndelangen added a commit to storybookjs/storybook that referenced this issue Aug 4, 2018
@ndelangen
Copy link

Am also experiencing this, can confirm it's been fixed on the canary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests