angularjs - ngStorage module not found only in gulp dist:serve? -


i strike error 1 again, last time have fixed not know how fixed again occurs.

i have ngstorage module installed , projecr run fine when it's in development ( gulp clean serve ) when goes production ( gulp serve:dist) , execute main page blank , there error in console

uncaught error: [$injector:modulerr] failed instantiate module app due to: error: [$injector:modulerr] failed instantiate module ngstorage due to: error: [$injector:nomod] module 'ngstorage' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument. http://errors.angularjs.org/1.5.8/$injector/nomod?p0=ngstorage

although have checked it's installed can can suggest issue , how fix this? here bower.json

{   "name": "project",   "version": "0.1.1",   "dependencies": {     "angular-animate": "1.5.8",     "angular-touch": "~1.5.0",     "angular-sanitize": "~1.5.0",     "angular-messages": "~1.5.0",     "angular-aria": "~1.5.0",     "jquery": "~2.1.4",     "angular-resource": "~1.5.0",     "angular-ui-router": "~0.2.15",     "bootstrap": "~3.3.6",     "angular-bootstrap": "~1.1.2",     "angular-toastr": "~2.0.0",     "moment": "~2.13.0",     "animate.css": "~3.4.0",     "angular": "~1.5.0",     "ng-table": "^1.0.0",     "pace": "~1.0.2",     "metismenu": "~2.0.2",     "fontawesome": "~4.5.0",     "roboto-fontface": "^0.7.0",     "angular-ui-validate": "^1.2.2",     "ng-stomp": "^0.2.0",     "angular-scrollable-table": "^1.1.1",     "aws-sdk": "aws-sdk-js#^2.7.7",     "ng-file-upload": "^12.2.13",     "angular-recaptcha": "^4.0.3",     "ng-csv": "^0.3.6",     "ngstorage": "^0.3.11",     "intl-tel-input": "5.1.7",     "international-phone-number": "^0.0.16",     "angular-chart.js": "^1.1.1"   },   "devdependencies": {     "angular-mocks": "1.5.8"   },   "overrides": {     "bootstrap": {       "main": [         "less/bootstrap.less",         "dist/fonts/glyphicons-halflings-regular.eot",         "dist/fonts/glyphicons-halflings-regular.svg",         "dist/fonts/glyphicons-halflings-regular.ttf",         "dist/fonts/glyphicons-halflings-regular.woff",         "dist/fonts/glyphicons-halflings-regular.woff2"       ]     },     "fontawesome": {       "main": [         "less/font-awesome.less",         "fonts/fontawesome-webfont.eot",         "fonts/fontawesome-webfont.svg",         "fonts/fontawesome-webfont.ttf",         "fonts/fontawesome-webfont.woff",         "fonts/fontawesome-webfont.woff2"       ]     },     "roboto-fontface": {       "main": [         "css/roboto/less/roboto-fontface.less"       ]     },     "chart.js": {                "main": [                    "dist/chart.bundle.min.js"                ]            }    },   "resolutions": {     "jquery": "~2.1.4",     "angular": "1.5.8"   },         "description": "project manager on-premise",   "main": "",   "homepage": "index.html",   "ignore": [     "**/.*",     "node_modules",     "bower_components",     "test",     "tests"   ] } 

i think there issue related stmop or using broswer-sync , may cause cant sure.

see console image

issue dues 1 of library --which included-- missing semicolon in it's main js file

cause:

i using ng-stomp in project , installed library using bower install , when run gulp dist:serve minified files mentioned in main bower.json file , read bower_components/ng-stomp/package.json main file location "main": "src/ng-stomp.js" , file missing semicolon in end when next js library ( ngstorage) minified, not recognize it's parser , throws error.

solution:

override main file writing below code in bower.json overrides block ( add ng-stomp.min.js has semicolon in end)

 "ng-stomp": {             "main": [                 "dist/ng-stmop.min.js"             ]         } 

hope helps someone


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -