Could not find module `ember` imported from `my-project/app`


#1

Somehow out of nowhere I’m having this problem with running a project and an add-on as well. And I have no clue what’s going on.

I have an Ember add-on and a consuming application. But somehow when I try to ember serve the project:

Could not find module `ember` imported from 'my-project/app'

In case of the add-on:

Could not find module `ember` imported from 'dummy/app'

Followed by a link to a source map which only shows a line where Ember is used, which doesn’t make anything clear.

It appears there has been a problem with jquery in the past, but the add-on doesn’t even use jquery. To make things even weirder, I have another add-on with the same dependencies that works fine. Apparently this problem appeared just overnight.

I removed all npm/bower folders and cache, removed the projects and git clone them again, npm install and bower install, reinstalled Ember, git checkout to an older tag that has always worked fine … but without any success.

I’m completely dazed and confused right now, so any suggestion that might help me is appreciated!

Specs:

ember-cli: 2.6.3
node: 6.6.0
os: linux x64 (Ubuntu 16.04)

Project’s NPM dependencies:

"devDependencies": {
    "broccoli-asset-rev": "^2.4.2",
    "ember-ajax": "^2.0.1",
    "ember-cli": "2.6.3",
    "ember-cli-app-version": "^1.0.0",
    "ember-cli-babel": "^5.1.6",
    "ember-cli-content-security-policy": "0.5.0",
    "ember-cli-dependency-checker": "^1.2.0",
    "ember-cli-fastclick": "1.3.0",
    "ember-cli-htmlbars": "^1.0.8",
    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
    "ember-cli-inject-live-reload": "^1.4.0",
    "ember-cli-jshint": "^1.0.0",
    "ember-cli-mirage": "0.2.1",
    "ember-cli-qunit": "^1.4.0",
    "ember-cli-release": "^0.2.9",
    "ember-cli-sass": "5.5.1",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-cli-yuidoc": "0.8.7",
    "ember-composable-helpers": "0.26.1",
    "ember-data": "2.6.1",
    "ember-data-model-fragments": "2.3.2",
    "ember-export-application-global": "^1.0.5",
    "ember-font-awesome": "2.1.1",
    "ember-hook": "1.3.4",
    "ember-load-initializers": "^0.5.1",
    "ember-resolver": "^2.0.3",
    "ember-responsive": "1.2.7",
    "ember-route-action-helper": "0.3.3",
    "ember-simple-auth": "1.1.0",
    "ember-simple-auth-token": "1.1.1",
    "ember-truth-helpers": "1.2.0",
    "ember-uploader": "1.1.0",
    "ember-validations": "git@github.com:DockYard/ember-validations.git#5502c4c",
    "ember-wormhole": "0.4.0",
    "express": "^4.14.0",
    "glob": "^7.0.5",
    // Several private add- ons, including the one that breaks
    "liquid-fire": "0.24.1",
    "loader.js": "^4.0.1",
    "morgan": "^1.7.0"
  },
  "dependencies": {
    "ember-responsive": "^1.2.6",
    "ember-router-generator": "^1.2.1",
    "fs-extra": "^0.30.0",
    "fs.extra": "^1.3.2"
  }

Project’s bowser dependencies:

"dependencies": {
    "ember": "~2.6.0",
    "ember-cli-shims": "0.1.1",
    "ember-cli-test-loader": "0.2.2",
    "ember-qunit-notifications": "0.1.0",
    "fastclick": "^1.0.6",
    "pretender": "~1.1.0",
    "Faker": "~3.1.0",
    "font-awesome": "~4.5.0"
  },
  "devDependencies": {
    "modular-scale": "^2.1.3"
  }

Removing the add-on from the project didn’t work as well.


#2

Strange. Did you check if ember new testapp still gives you a working Ember app?


#3

I started having the same issue today using ember-cli v2.7.0. An addon which was working just fine 2 days ago is giving the error now: Could not find module ```ember ``` imported from 'dummy/app'

I also tried creating a new addon: ember addon test-addon. The ember-welcome-page rendered just fine, but as soon as I removed that dependency from the package.json file I got the same error.


#4

This happened to me today too, on an existing non-addon Ember CLI 2.7.x project.

The only way I could fix was by upgrading to Ember CLI 2.9.1 as well as upgrading the project to Ember 2.9.0 (by running ember init).


#5

I’m also running into this with a project using Ember CLI 2.7. Occurred today while setting up a new laptop and git cloning an existing project.


#6

I also fixed it by updating to ember-cli 2.9.1 and upgrading all Ember core dependencies as well. Not sure which dependency broke it, but it’s not bad practice to update everything once in a while.

NPM:

"devDependencies": {
    "broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^2.4.1",
    "ember-cli": "2.9.1",
    "ember-cli-app-version": "^2.0.0",
    "ember-cli-babel": "^5.1.7",
    "ember-cli-dependency-checker": "^1.3.0",
    "ember-cli-fastclick": "1.3.0",
    "ember-cli-htmlbars": "^1.0.10",
    "ember-cli-htmlbars-inline-precompile": "^0.3.3",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-jshint": "^1.0.4",
    "ember-cli-mirage": "0.2.1",
    "ember-cli-qunit": "^3.0.1",
    "ember-cli-release": "^0.2.9",
    "ember-cli-sass": "5.5.2",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-test-loader": "^1.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-cli-yuidoc": "0.8.7",
    "ember-composable-helpers": "1.0.0",
    "ember-data": "2.9.0",
    "ember-data-model-fragments": "2.3.2",
    "ember-export-application-global": "^1.0.5",
    "ember-font-awesome": "2.2.0",
    "ember-hook": "1.3.5",
    "ember-load-initializers": "^0.5.1",
    "ember-resolver": "^2.0.3",
    "ember-responsive": "2.0.0",
    "ember-route-action-helper": "2.0.0",
    "ember-simple-auth": "1.1.0",
    "ember-simple-auth-token": "1.1.1",
    "ember-truth-helpers": "1.2.0",
    "ember-uploader": "1.2.1",
    "ember-validations": "git@github.com:DockYard/ember-validations.git#5502c4c",
    "ember-wormhole": "0.5.0",
    "express": "^4.14.0",
    "glob": "^7.0.5",
    // Several private add-ons
    "liquid-fire": "0.26.4",
    "loader.js": "^4.0.11",
    "morgan": "^1.7.0"
  },
  "dependencies": {
    "ember-responsive": "2.0.0",
    "ember-router-generator": "^1.2.2",
    "fs-extra": "^1.0.0",
    "fs.extra": "^1.3.2"
  }

Bower:

"dependencies": {
    "ember": "~2.9.0",
    "ember-cli-shims": "0.1.3",
    "fastclick": "^1.0.6",
    "pretender": "~1.1.0",
    "Faker": "~3.1.0",
    "font-awesome": "^4.7.0"
  },
  "devDependencies": {
    "modular-scale": "^2.1.3"
  }

#7

I had the same issue. It was due to lodash version 4.17.0 containing a bug. Pinning lodash in npm to the 4.16 series fixed this issue for us!