Skip to content

Cannot read property 'end' of null #614

@TimWolla

Description

@TimWolla

Babili crashes with the follow stack trace:

TypeError: foo.js: Cannot read property 'end' of null
    at _evaluate (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/evaluation.js:159:57)
    at evaluate (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/evaluation.js:65:17)
    at NodePath.evaluate (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/evaluation.js:41:15)
    at isPureAndUndefined (/pwd/node_modules/babel-plugin-transform-remove-undefined/lib/index.js:19:25)
    at PluginPass.ReturnStatement (/pwd/node_modules/babel-plugin-transform-remove-undefined/lib/index.js:138:15)
    at newFn (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/usr/local/share/.config/yarn/global/node_modules/babel-traverse/lib/context.js:150:16)

My .babelrc is as follows:

{ "presets": [ "es2015",
               "babili"
             ]
}

A minimal example that reproduces the error is:

function a() {
	var c = 1

	class B {

	}

	return B
}

My package.json is:

{
  "dependencies": {
    "babel-preset-env": "^1.5.2",
    "babel-preset-es2015": "^6.24.1",
    "babili": "^0.1.4"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugwith es2015The bug is caused when used with es2015-block-scoping plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions