ngStorage icon indicating copy to clipboard operation
ngStorage copied to clipboard

Doesn't work with Browserify

Open rafakato opened this issue 9 years ago • 5 comments

Hello,

When I load your module in my project, I get this error in console:

Uncaught Error: Cannot find module 'angular'

After inspecting the code I saw that the error throw here: https://github.com/gsklee/ngStorage/blob/master/ngStorage.js#L7

I need to do something your module to work with browserify?

Thanks in advance

rafakato avatar Oct 15 '15 18:10 rafakato

Shouldn't be anything special. Have you included angular?

egilkh avatar Oct 16 '15 04:10 egilkh

Yes,

I've configured the shim for both angular and ngstorage, I also use ui-router and angular-permissions modules with no problem. But when I add your module it throws an error.

To make things work for me I've modified the order of the startup: https://github.com/rafakato/ngStorage/blob/master/ngStorage.js#L1-L11

If there is a angular in the window object I use it instead of loading it from require.

Again, this works for me, but I didn't make any tests. I've just done this so I can your module. When I have some time I'll try to go deeper in this error.

rafakato avatar Oct 16 '15 19:10 rafakato

I have the same issue uglify. Changing the order of startup like rafakato fixed it for me as well.

coryisakson avatar Oct 23 '15 08:10 coryisakson

Unfortunately, it does not helps in my case (

Browserify Error { [Error: Cannot find module 'angular' from <...> bower_components/ngstorage ...

M-Beliaev avatar Feb 08 '16 16:02 M-Beliaev

Same here { [Error: Cannot find module 'angular' from <...> bower_components/ngstorage ...

abachuk avatar Aug 05 '16 01:08 abachuk