Upgrading from 2.12 to 2.17 with error: Could not find module ember-resolver


#1

I’m upgrading from 2.12.2 -> 2.17 and I don’t know the cause of the error: "Could not find module ember-resolver imported from my-app/resolver".

I was using ember-cli-update to do the upgrade.


#2

Hi, @Garrick!

  1. Do you have a file resolver.js in the root folder with code in it:

    import Resolver from 'ember-resolver';
    export default Resolver;
    
  2. Do you have in your devDependencies "ember-resolver": "^4.0.0", package?

  3. How and where do you import Resolver?


#3

Hi @yuriyk!

  1. I have a resolver.js file in the app folder with the code you described.
  2. Yes, I have "ember-resolver": "^4.0.0" in the devDependencies of the package.json.
  3. app/app.js has code to import the resolver with the following:
    import Resolver from './resolver';
    

#4

Hmm. All looks good, like in my app. Would be good, if you could share your issue via https://ember-twiddle.com


#5

Hello @Garrick,

I have just finished migrating my app from 2.12.1 to 2.17.1. I do not have an answer for your problem but I want to share silly a technique that I use in Rails and Ember that has given me great results.

First I creat a new empty app using Ember 2.17.1.

Then I use a diff tool like kaleidoscope on mac os or meld on all the platforms and compare my app’s folder with the new app folder.

I compare file by file and overwrite only the modified lines in my old app.

In practice it is easier than it sounds.

If you have already upgraded you app using ember-cli-update it does not do any harm to compare your migrated app with a brand new ember app. Perhaps you can spot something missing or incorrectly migrated.

Hope this helps.


#6

@hectorsq Thanks for the suggestion!

I tried doing something similar, with a brand new app and just diffing the changes as best I could with Webstorms tools.

After a while, I basically started my application from scratch and reverting deleted files and changes here and there starting with the package.json, and them changes in my ember-cli-build.js, configs, and additional folder changes.

So, I think I’ve found the problem which I filed an issue with ember-cli and PR to fix it!

The issue is that changes in 2.17.x introduced an issue with outputPaths.vendor.js options.

That’s for help to look into the issue, everyone!