Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Ember-CLI with instructions from README #84

Closed
micahblu opened this issue Sep 30, 2014 · 12 comments
Closed

Not working with Ember-CLI with instructions from README #84

micahblu opened this issue Sep 30, 2014 · 12 comments

Comments

@micahblu
Copy link
Contributor

I installed as instructed: bower install --save-dev ember-localstorage-adapter

and have this in adapters/application.js:

import DS from 'ember-data';

export default DS.LSAdapter.extend({
    namespace: 'todoapp'
});

Wouldn't I also need to import the localstorage adapter somehow? I tried to import it from the bower directory but still no luck

This is the error I have:
Error while processing route: todos.index Cannot read property 'extend' of undefined TypeError: Cannot read property 'extend' of undefined

@fsmanuel
Copy link
Contributor

You need to do an app.import in the broccoli file

Am 30.09.2014 um 22:37 schrieb Micah Blu notifications@github.com:

I installed as instructed: bower install --save-dev ember-localstorage-adapter

and have this in adapters/application.js:

import DS from 'ember-data';

export default DS.LSAdapter.extend({
namespace: 'todoapp'
});
Wouldn't I also need to import the localstorage adapter somehow? I tried to import it from the bower directory but still no luck

This is the error I have:
Error while processing route: todos.index Cannot read property 'extend' of undefined TypeError: Cannot read property 'extend' of undefined


Reply to this email directly or view it on GitHub.

@micahblu
Copy link
Contributor Author

That makes sense, however not sure what key name to use? I'm already using development and production for emberdata, just tried to use 'localstorage' as key name but that produced an error. Thanks a ton for your help

@micahblu
Copy link
Contributor Author

Might be a good idea as well to show a sample section of the broc file importing the library.

@micahblu
Copy link
Contributor Author

Nevermind got it working.. Thanks!

@fsmanuel
Copy link
Contributor

It's the path to the file. bower_components/ember-local storage-adapter/localstorage_adaper.js or something similar. Would be great if you open a PR to document that in the readme.

Am 01.10.2014 um 00:19 schrieb Micah Blu notifications@github.com:

Might be a good idea as well to show a sample section of the broc file importing the library.


Reply to this email directly or view it on GitHub.

@micahblu
Copy link
Contributor Author

Think I'll do that

@dzena
Copy link

dzena commented Mar 2, 2015

Hello,
i have followed the instruction for setting up the adapter from ember-cli (http://stackoverflow.com/questions/24327090/how-to-import-module-ember-localstorage-adapter-with-ember-cli).
Unfortunately, i'm stuck at the
Error message: " Error while processing route: products.index Cannot read property 'extend' of undefined TypeError: Cannot read property 'extend' of undefined".

I'll be happy with any help somebody can provide.
Regards

@dzena
Copy link

dzena commented Mar 2, 2015

I solved the problem.
Sorry for false alarm.

All I had to do is to restart the ember server.

Best regards.

@kurko
Copy link
Collaborator

kurko commented Mar 20, 2015

😄

@planetcrypton
Copy link

I'm stuck here with the same symptoms:
Ran: $ ember install:bower ember-localstorage-adapter
app/adapters/application.js:

import DS from 'ember-data';

// export default DS.FixtureAdapter.extend({});
export default DS.LSAdapter.extend({
    namespace: 'tapp2'
});

These are my versions:
DEBUG: -------------------------------
ember.debug.js:5197DEBUG: Ember : 1.11.1
ember.debug.js:5197DEBUG: Ember Data : 1.0.0-beta.16.1
ember.debug.js:5197DEBUG: jQuery : 1.11.2
ember.debug.js:5197DEBUG: -------------------------------

Error:
Error while processing route: postmen.index Cannot read property 'extend' of undefined TypeError: Cannot read property 'extend' of undefined

What exactly would I need to do in the Brocfile.js, that isn't very clear to me?

@scambier
Copy link

scambier commented May 6, 2015

Before the last line:

app.import('bower_components/ember-localstorage-adapter/localstorage_adapter.js');

@planetcrypton
Copy link

I just had this working, when my code-buddy pointed out for me that I should run this in stead:

$ ember install ember-localstorage-adapter

That made it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants