Getting "Could not find module `ember-resolver`" error


I just upgraded ember from 3.15 to 3.17, along with several other addons that had newer versions. (I’m also using node 13. 3.0, if that’s relevant.)

It works fine in Dev Mode and all of my tests pass. However, when I deploy the app I get the following:

Error: Could not find module ember-resolver imported from bnc/app

Right before that there is also this error:

TypeError: t.createSuper is not a function

But after searching around, it seems like the problem is probably with ember-resolver.

As per some other posts “out there”, I also did an rm -rf node_modules tmp and npm cache clean --force, followed by an npm install.

Also, I didn’t change any of the code during the upgrade. Typically when I upgrade ember I do that, followed by updating outdated addons a few at a time so I can back out if there is a problem. And that’s all I do.

I checked the “release diffs” going from 3.15 --> 3.16 and 3.16 --> 3.17 and there weren’t any resolver-related changes that I could see.

Here is the line from my the devDependencies section in package.json:

"ember-resolver": "^7.0.0",

and the ember-resolver package does exist in my node_modules directory.

Here are the contents of bnc/app.js, apparently the source of the problem. This didn’t change during the upgrade, nor has the version of ember-resolver referenced in package.json, i.e., the “culprits” are exactly the same as they were before the upgrade.

import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

export default class App extends Application {
  modulePrefix = config.modulePrefix;
  podModulePrefix = config.podModulePrefix;
  Resolver = Resolver;

loadInitializers(App, config.modulePrefix);

Can someone shed some light on this? I have spent hours on it, am at my wits end, and have no idea how to proceed.

Thanks, Larry

This is almost certainly the root cause of issues. I just fixed this error and released as ember-source@3.17.1 and ember-source@3.16.5 (for LTS users). I wrote a bit of an explanation of what was going on in the PR:

Can you confirm that you are using ember-source@3.17.1?

1 Like

That was it! I just upgraded ember-source from 3.17.0 to 3.17.1 and it worked like a charm!


Thanks, Larry

P.S. Okay, party’s over. Get back to work. :wink: