question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error: Cannot read property 'isIfStatement' of null

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
ChrisWilescommented, Jun 21, 2018

When will this be fixed on the main branch?

12reactions
swernerxcommented, 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)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This will result in Uncaught TypeError: Cannot read property 'value' of null . The reason will be that the element with id input...
Read more >
Error: Cannot read property of null - Stack Overflow
start to this.props.start , the error goes away but the board does not render . How can I resolve this situation ?
Read more >
if...else - JavaScript - MDN Web Docs - Mozilla
To execute no statements, use an empty statement. statement2. Statement that is executed if condition is falsy and the else clause exists.
Read more >
typeerror can not read property x of null - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
babel/types
elements : Array<null | Expression | SpreadElement> (default: [] ) ... Aliases: Standardized , Property , Accessor ... isIfStatement(node, opts) and t.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found