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

bower angluar-localforage config is undefined #37

Closed
bahtou opened this issue Nov 3, 2014 · 11 comments
Closed

bower angluar-localforage config is undefined #37

bahtou opened this issue Nov 3, 2014 · 11 comments
Labels

Comments

@bahtou
Copy link

bahtou commented Nov 3, 2014

I followed through with the readme by installing both localforage and angular-localforage with bower.

I tried bundling both files with browserify and I keep getting the following error in chrome:

TypeError: Cannot read property 'config' of undefined
at new LocalForageInstance (http://localhost:3000/angular-localforage/dist/angular-localforage.js:57:17)

Prior to this error I was getting other errors in localforage about not being able to find the drivers and the promise library.

Any thoughts?

@ocombe
Copy link
Collaborator

ocombe commented Nov 3, 2014

You need to install both with bower (which you did), but you also need to include the js file for localForage before the one for angular-localForage. Did you do that ? This config error means that angular-localForage cannot find the lib localForage.

@bahtou
Copy link
Author

bahtou commented Nov 3, 2014

in my index.html I have the bundle.js which includes angular and localforage.
Then i have a script tag with angular-localforage.

So yes, I do put the localforage before angular-localforage but it's in the bundle.
Does that make a difference?

UPDATE: I have tried this way as well
require('../../bower_components/angular/angular.js');
require('../../bower_components/localforage/src/localforage.js');
require('../../bower_components/angular-localforage/dist/angular-localforage.js');

@bahtou
Copy link
Author

bahtou commented Nov 3, 2014

In the console, I also get the error:
Error: Cannot find module 'localforage' from '/Users/thisUser/Documents/myApp/bower_components/angular-localforage/dist' at /Users/thisUser/Documents/myApp/node_modules/browserify/node_modules/resolve/lib/async.js:50:17

@ocombe
Copy link
Collaborator

ocombe commented Nov 3, 2014

I don't know, I've never used browserify before, sorry... :-/

@bahtou
Copy link
Author

bahtou commented Nov 3, 2014

oh ok.

I'll look more into it and let you know what I find.

Thanks!

@ocombe
Copy link
Collaborator

ocombe commented Nov 6, 2014

Can you test the master and see if the PR #40 fixes this problem ?

@bahtou
Copy link
Author

bahtou commented Nov 6, 2014

does not fix the problem.

I think the issue is in localstorage. I get a few errors with localstorage.

I'm filling an issue with them soon.

@ocombe
Copy link
Collaborator

ocombe commented Nov 6, 2014

Ok thanks, let me know!

@cinder92
Copy link

same issue here! im trying to use it with electron, but is not working! im desesperate! :(

@ocombe
Copy link
Collaborator

ocombe commented May 21, 2015

You did include both files and in the right order ?

@cinder92
Copy link

yes i have

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

No branches or pull requests

3 participants