Urgent: Meteor + babel-compiler 7.0.0 (not beta) breaks during build

It’s impossible to start any Meteor app with this combination because of the following error:

TypeError: Cannot read property '1' of null
    at babel-runtime.js (packages/babel-runtime.js:51:13)
    at fileEvaluate (packages/modules-runtime.js:322:7)
    at Module.require (packages/modules-runtime.js:224:14)
    at require (packages/modules-runtime.js:244:21)
    at packages/babel-runtime.js:101:15
    at packages/babel-runtime.js:108:3
    at ./.meteor/local/build/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>)
    at ./.meteor/local/build/programs/server/boot.js:220:19
    at ./.meteor/local/build/programs/server/boot.js:471:5

The error is due to this code, which contains a subtle bug at packages/babel-runtime.js:51:13:

var match = /^7\.0\.0-(beta|rc)\./.exec(babelRuntimeVersion);
  if (match &&
      match[1] === "rc" ||
      (match[1] === "beta" &&
       parseInt(babelRuntimeVersion.split(".").pop(), 10) > 55)) {

see it? It should read:

var match = /^7\.0\.0-(beta|rc)\./.exec(babelRuntimeVersion);
  if (match &&
        (match[1] === "rc") ||
        (match[1] === "beta" && parseInt(babelRuntimeVersion.split(".").pop(), 10) > 55)
  ) {

// (might be better to write this as a condition that breaks exits early if 'match' does not exist..)

Meteor team: please fix this!

As an aside: I don’t actually want babel-compiler in the project at all. We have an in-house web app and control the browsers that use the app. We don’t use any Node 8.10+ features. I couldn’t see any dependency on babel-compiler in the project anywhere but it appears we are forced to use it for whatever reason, along with the associated bugs and slow compilation…

In any case, it would be awesome if the above bug could be fixed ASAP so we can build the app again.


Your title suggests you already have this work-around but for dense people like me - this is how I’m currently mitigating the issue

meteor npm install --save-exact @babel/runtime@7.0.0-beta.55

1 Like