Trying to import Geolib from npm by:
npm install geolib --save
which generates in package.json
"dependencies": {
"bower": "^1.8.8",
"ember-cli": "~2.18.2",
"ember-cli-less": "3.0.1",
"geolib": "^3.3.1"
},
then in my test.js component:
import { getDistance } from 'geolib';
But ( yes, there is but ) when i access a page, it generates error:
loader.js:228 Uncaught Error: Could not find module `geolib` imported from `wash-app-dashboard/components/test`
at missingModule (loader.js:228)
at findModule (loader.js:239)
at Module.findDeps (loader.js:173)
at findModule (loader.js:243)
at requireModule (loader.js:26)
at Class._extractDefaultExport (index.js:389)
at Class.resolveOther (index.js:109)
at Class.superWrapper [as resolveOther] (ember-utils.js:418)
at Class.resolve (resolver.js:133)
at _resolve (container.js:886)
Something wrong with my settings, or what ? Cant find any solution but comment out the code.
Edit: I know, i've got an old project to work on in my hand. Currently upgrading from 2.4 ember to 2.18 ( then to latest ember ).
I see you have "ember-cli": "~2.18.2",
installed. That is a pretty old ember-cli
version. Back then ember-auto-import
was not part of the default blueprint.
So do you have ember-auto-import
installed? It is what basically makes imports to just work.