BABEL_TRANSFORM_ERROR – babel traverse context – cannot read property “removeBinding” of null

Bug Report

EDIT by @nicolo-ribaudo

You can workaround this bug by making sure that @babel/core uses an older @babel/traverse version.
If you are using yarn you can specify "@babel/traverse": "7.12.0" in resolutions, otherwise you can try downgrading it as described by #12383 (comment).

#12331 after this pr

“This is technically a breaking change (we are changing the default value of a parameter in the public API), but I couldn’t find anyone online using that parameter and I’m not sure why anyway would not wont it to use the correct context.”

is there anyone that do code review, here @babel ?

What do you think about semver?


Author: Fantashit

2 thoughts on “BABEL_TRANSFORM_ERROR – babel traverse context – cannot read property “removeBinding” of null

  1. I think babel-plugin-minify-simplify is triggering this error (whether the fault is with the plugin or babel itself I don’t know). It can be seen when minifying bowser v1.9.4 for example.

    To reproduce:

    1. Using node.js LTS v14.15.1 with npm version 6.14.8, set up a clean node project.
    2. Run npm install --save-dev @babel/cli @babel/core babel-preset-minify bowser@1.9.4
    3. Run npx babel --presets=babel-preset-minify node_modules/bowser/bowser.js

Comments are closed.