jeudi 11 juin 2020

import of geolib doesn't work in Ember-cli

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.




Aucun commentaire:

Enregistrer un commentaire