Some way, ANY way, to find the root cause of this dependency error?

I have two versions of a project A & B, almost identical, but I did a bunch of refactoring on version B.

Now I have this error in version B.

 (STDERR) /home/yourself/.meteor/packages/meteor-tool/.1.4.4_1.1t9hste++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
 (STDERR) 						throw(ex);
 (STDERR) 						^
 (STDERR) Error: Cannot find module '../helpers/typeof'
 (STDERR)     at require (packages/modules-runtime.js:123:19)
 (STDERR)     at meteorInstall.node_modules.mmks_widget.node_modules.babel-runtime.helpers.possibleConstructorReturn.js (packages/modules.js:3464:16)
 (STDERR)     at fileEvaluate (packages/modules-runtime.js:197:9)
 (STDERR)     at require (packages/modules-runtime.js:120:16)
 (STDERR)     at meteorInstall.node_modules.mmks_widget.dist.utils.js (packages/modules.js:3060:35)
 (STDERR)     at fileEvaluate (packages/modules-runtime.js:197:9)
 (STDERR)     at require (packages/modules-runtime.js:120:16)
 (STDERR)     at meteorInstall.node_modules.mmks_widget.dist.client.index.js (packages/modules.js:1501:15)
 (STDERR)     at fileEvaluate (packages/modules-runtime.js:197:9)
 (STDERR)     at require (packages/modules-runtime.js:120:16)
=> Exited with code: 1

Clearly the problem is with my module mmks_widget, but none of the refactoring did anything to that module.

I’ve tried adding babel-helpers to the module’s package.json and to the Meteor app’s package.json as shown . . .

  "dependencies": {
    "babel-helpers": "6.24.1",
    "babel-runtime": "6.23.0"

. . . but it made no difference.

I am at a complete loss.

I’ll be grateful for any suggestions on how can I begin to track down the cause of this!

I’ll assume that you’ve done this, but I have run into this randomly in refactors, where the build process seems to be looking for a reference/pointer that doesn’t seem to exist. Usually a meteor reset will resolve it for me. I honestly have no understanding of what would cause it, but it has worked for me when I am looking for errors that just don’t seem to exist.

I appreciate your suggestion.

Actually, I got much more aggressive, purging everything to do with Meteor and Node and NPM, before completely reinstalling, rebuilding and retesting.

It’s something in the refactoring I did, that’s killing it, but I haven’t yet figured out where or what.


Looks like a bad relative path. I’d grep for all occurrences of ‘…/helpers/typeof’ and then verify each relative path.

Ok. Found the root cause.

The mmks_widget module is one of several that appear in the node_modules directory as symlinks created with meteor npm link mmks_xyz

At some point, I had stopped linking them and had also removed them from packages.json. I resumed linking them in, but forgot to add them to packages.json.

I do not understand WHY they have to be in packages.json. I thought packages.json just advised npm what to pull in from outside, but it certainly seems to be more than that.

Sigh! More to study! :weary:

1 Like