mardi 28 avril 2015

Firefox OS app beginner, can't import localforage properly : Could not find module `ember-localforage-adapter/adapters/localforage`

I'm currently learning how to develop a new app in Firefox OS, following step-by-step the MDN tutorial starting here : http://ift.tt/1aFegb6

Everything went pretty smoothly until the part concerning the Model, here : http://ift.tt/1HNJTMf

Specifically at the point of installing LocalForage.
I tried the first :

ember install:addon ember-localforage-adapter

And got the error message described in the tutotrial, so I tried the other command bower install localforage -v '1.2.2' It just returned the bower version.
So I tried bower install localforage alone and it worked. I got the new folder in myapp/bower_components/localforage.

The tutorial next gives the instruction to use the code :

import LFAdapter from 'ember-localforage-adapter/adapters/localforage';

export default LFAdapter.extend({
    namespace: 'ShoppingLists'
});

Aaaaand that doesn't work. I got the error message :

Error while processing route: lists.index Could not find module 'ember-localforage-adapter/adapters/localforage' imported from `'myapp/adapters/application' requireFrom@http://localhost:4200/assets/vendor.js:119:1

I didn't get the logic behind the import call, no ember-local-forage-adapter folder or something similar. I'm not comfortable with namespaces yet, but I know the theory. Is there a namespace problem somewhere I can't recognize ? Is it related to ember-data ?

I can give the full error message, but I'm pretty sure that won't help.
I did my best to figure it out alone, but I ran out of ideas, so I'm asking here.

Thank you for the help :)




Aucun commentaire:

Enregistrer un commentaire