gsklee / ngStorage

localStorage and sessionStorage done right for AngularJS.
MIT License
2.34k stars 461 forks source link

ngStorage module not found error in production package #268

Closed zymr-keshav closed 7 years ago

zymr-keshav commented 7 years ago

This is a really weird issue I encountered many times but unable to solve it permanently, sometimes it resolved after reinstall the ngstorage But this time it doesn't work out.

I am using angular 1.6.8 and "ngstorage": "^0.3.11" and using gulp as a task runner. whenever I run my project on development stage ( using gulp clean serve) it works fine BUT when i build the production stage ( using gulp serve:dist) , Index page goes blank and there is long red error detail in the console that ngStoarge module is not defined

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:modulerr] Failed to instantiate module ngStorage due to: Error: [$injector:nomod] Module 'ngStorage' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.5.8/$injector/nomod?p0=ngStorage

see the attached screenshot

Please tell me why this error comes up and how to solve it? Also see the issue on SO

I tried to debug the issue using breakpoints in console but it does not help me out I am using ngstomp librray also and I suspect that it may be reason.

zymr-keshav commented 7 years ago

it was the issue due to another library which was missing semicolon (;)in the end, and it cause the error while appending next js library. one can see the answer in under mentioned SO question