[solved] ECMAScript / Babel Error with 1.6.1: Cannot read property 'bindings' of null

So I followed ben’s post pretty closely but I can’t get it to work :frowning:

Error:

    Errors prevented startup:

   While processing files with ecmascript (for target web.browser):

   /Users/patrick/.meteor/packages/ecmascript/.0.10.0.ugc54c.n6l9k++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/scope/index.js:921:13:
   Cannot read property 'bindings' of null
   at Scope.moveBindingTo
   (/Users/patrick/.meteor/packages/ecmascript/.0.10.0.ugc54c.n6l9k++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/scope/index.js:921:13)
   at BlockScoping.updateScopeInfo
   (/Users/patrick/dev/orderlion/orderlion_react/app/node_modules/babel-preset-meteor/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
   at BlockScoping.run
   (/Users/patrick/dev/orderlion/orderlion_react/app/node_modules/babel-preset-meteor/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
   at PluginPass.BlockStatementSwitchStatementProgram
   (/Users/patrick/dev/orderlion/orderlion_react/app/node_modules/babel-preset-meteor/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)

... and so on ...

Can anyone help?

from package.json:

"devDependencies": {
    "babel-preset-meteor": "^6.22.0",
    "chimp": "^0.41.2"
  },
  "dependencies": {
    "@babel/runtime": "^7.0.0-beta.39",
    "antd": "^3.1.6",
    "aws-sdk": "^2.188.0",
    "bcrypt": "^0.8.7",
    "classnames": "^2.2.5",
    "console-polyfill": "^0.2.2",
    "copy-to-clipboard": "^3.0.6",
    "cron": "^1.3.0",
    "dom-scroll-into-view": "^1.2.1",
    "eol": "^0.9.1",
    "fastclick": "^1.0.6",
    "file-saver": "^1.3.3",
    "iconv-lite": "^0.4.19",
    "indexof": "0.0.1",
    "jquery": "^2.2.4",
    "jquery-validation": "^1.15.1",
    "left-pad": "^1.2.0",
    "lodash": "^4.17.4",
    "mailgun-js": "^0.7.11",
    "meteor-node-stubs": "^0.2.6",
    "moment": "^2.20.1",
    "moment-range": "^3.1.1",
    "nivo": "^0.30.1",
    "object-path": "^0.11.4",
    "pdfmake": "^0.1.35",
    "prop-types": "^15.5.8",
    "pubsub-js": "^1.6.0",
    "raven": "^2.4.0",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-ga": "^2.4.1",
    "react-router": "^3.2.0",
    "react-sortablejs": "^1.3.6",
    "sortablejs": "^1.7.0",
    "styled-components": "^2.4.0",
    "throttle-debounce": "^1.0.1",
    "ua-parser-js": "^0.7.10",
    "user-agent-parser": "^0.6.0",
    "validate.js": "^0.11.1",
    "xmlbuilder": "^9.0.4"
  }

.babelrc:

{
  "presets": ["meteor"]
}

I am a bit confused …

I tried screwing around with babel/runtime, @babel/runtime, removing all my babel plugins all that … no matter what I do I can’t get it to run and always end up with the same error.

EDIT:

Also tried running meteor update ecmascript babel-compiler babel-runtime --allow-incompatible-update out of desperation … no change.

No idea on this guys? I played around 2 hrs today and tried pretty much everything I could think of but couldn’t get it to work! :frowning: Gonna need your input here …

Have you tried removing "babel-preset-meteor" and .babelrc?

The ecmascript package automatically loads babel-preset-meteor so it could be confusing it by including your own

1 Like

oh wow … no idea why I didn’t think of that! thanks a bunch my friend!! this helped indeed!

2 Likes

Im having a similar problem but with no babelrc file

Cannot read property 'bindings' of null
   at Scope.moveBindingTo

updated my project to 1.6.1 but few things are broken, app was working fine before

edit: not the brightest, babelrc is in my root folder, i was looking in package.json - hope this helps anyone who makes similar error. deleting babelrc file from app directory worked A+

1 Like

What if I need .babelrc for other things, like Jest and Flow?

Then include just the extra plugins that you require and they will be merged into meteor’s babel compiler settings