Upgrade to 1.10.2: Class extends value #<Object> is not a constructor

I just upgraded my Meteor 1.6 app to 1.10.2 and see these kind of errors in the console. They seem to be related to ES6 classes extending other classes.

I had to upgrade Babel to the latest @babel/runtime to be compatible to 1.10.2, maybe this is related to the error? Also noticed that a Meteor dependency added typescript, so it might be related to this, too. I am not using TypeScript myself.

W20200515-10:34:29.574(2)? (STDERR) /Users/tom/.meteor/packages/meteor-tool/.1.10.2.3tt2gm.j3g39++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20200515-10:34:29.604(2)? (STDERR) 						throw(ex);
W20200515-10:34:29.604(2)? (STDERR) 						^
W20200515-10:34:29.604(2)? (STDERR) 
W20200515-10:34:29.605(2)? (STDERR) TypeError: Class extends value #<Object> is not a constructor or null
W20200515-10:34:29.605(2)? (STDERR)     at module (imports/api/spots/models/PhotonGeocoder.js:6:30)
W20200515-10:34:29.605(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:336:7)
W20200515-10:34:29.605(2)? (STDERR)     at Module.require (packages/modules-runtime.js:238:14)
W20200515-10:34:29.605(2)? (STDERR)     at Module.moduleLink [as link] (/Users/tom/.meteor/packages/modules/.0.15.0.us913k.8wuel++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:52:22)
W20200515-10:34:29.605(2)? (STDERR)     at module (imports/api/spots/models/common.js:1:644)
W20200515-10:34:29.605(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:336:7)
W20200515-10:34:29.606(2)? (STDERR)     at Module.require (packages/modules-runtime.js:238:14)
W20200515-10:34:29.606(2)? (STDERR)     at Module.moduleLink [as link] (/Users/tom/.meteor/packages/modules/.0.15.0.us913k.8wuel++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:52:22)
W20200515-10:34:29.606(2)? (STDERR)     at module (imports/api/spots/common.js:1:34)
W20200515-10:34:29.606(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:336:7)
W20200515-10:34:29.606(2)? (STDERR)     at Module.require (packages/modules-runtime.js:238:14)
W20200515-10:34:29.606(2)? (STDERR)     at Module.moduleLink [as link] (/Users/tom/.meteor/packages/modules/.0.15.0.us913k.8wuel++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:52:22)
W20200515-10:34:29.606(2)? (STDERR)     at module (imports/api/spots/models/GeoLocation.js:1:433)
W20200515-10:34:29.606(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:336:7)
W20200515-10:34:29.606(2)? (STDERR)     at Module.require (packages/modules-runtime.js:238:14)
W20200515-10:34:29.606(2)? (STDERR)     at Module.moduleLink [as link] (/Users/tom/.meteor/packages/modules/.0.15.0.us913k.8wuel++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:52:22)

It happened to me once after an upgrade. I noticed then that for some reasons the new Meteor was using parts of the old Meteor. I completely removed all other versions of Meteor and my NPM folder in the project, reopened the code editor, installed NPM and … it worked.

This sounds … weird. But I’ll try it. :slight_smile:

I think it’s got something to do with Babel. Going back 1-2 versions of Babel in your NPM might also make a change.

Neither helped. I am now getting this in the reverted 1.8 version as well.

I think it is caused by a circular module import dependency. Once I remove that, it works. But shouldn’t ES6 modules support circular dependencies?