Grunt-Built Production env, angularJS nomod error - javascript

I built an angularJS app scaffolded by yeoman, and the test environment with
grunt serve
went just as I expected, but when I tried to build the production environment with
grunt build
and run it with a nodemon, and I got no content except for the header/footer, and my chrome javascript console gave me the following error.
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' 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.3.12/$injector/nomod?p0=myApp
at http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:20442
at http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28774
at b (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28346)
at b (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28658)
at http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:5159
at f (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:20827)
at n (http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:4937)
at Sb (http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:6627)
at h (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:26459)
at _ (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:26769)
http://errors.angularjs.org/1.3.12/$injector/modulerr?p0=myApp&p1=E…0(http%3A%2F%2Flocalhost%3A3000%2Fscripts%2Fvendor.c0d4f7d6.js%3A3%3A26769)vendor.c0d4f7d6.js:3 (anonymous function)vendor.c0d4f7d6.js:4 (anonymous function)vendor.c0d4f7d6.js:3 fvendor.c0d4f7d6.js:4 nvendor.c0d4f7d6.js:4 Sbvendor.c0d4f7d6.js:3 hvendor.c0d4f7d6.js:3 _vendor.c0d4f7d6.js:3 $vendor.c0d4f7d6.js:7 (anonymous function)vendor.c0d4f7d6.js:2 _.Callbacks.kvendor.c0d4f7d6.js:2 _.Callbacks.l.fireWithvendor.c0d4f7d6.js:2 _.extend.readyvendor.c0d4f7d6.js:1 g
http://start.jcolemorrison.com/building-an-angular-and-express-app-part-1/
I was basically following this, and when i did npm start i got basically a blank page. Any suggestions?

Related

How to resolve the given error by Angular after production build(Subscription is not defined)?

I have a angular app that runs fine in ng build and served to my ASP.net core web server, but when i build the same application by ng build --prod command the project build successfully but when i serve my wwwroot folder in web server i am getting this error:-
Uncaught ReferenceError: Subscription is not defined
at Module.zUnb (main.2fbc30c2b70c6b016365.js:1)
at f (runtime.8844839a3cc2e01b8d02.js:1)
at Object.0 (main.2fbc30c2b70c6b016365.js:1)
at f (runtime.8844839a3cc2e01b8d02.js:1)
at t (runtime.8844839a3cc2e01b8d02.js:1)
at Array.r [as push] (runtime.8844839a3cc2e01b8d02.js:1)
at main.2fbc30c2b70c6b016365.js:1
and nothing appears on webpage. I have read about this on web but cannot resolved this error. What could be the reason for this error or how can i solve this. Please dont mind i have recently start with web development.Thankyou.
Update 1 : Upon running ng serve --prod sourceMap=true getting this error :-
Uncaught ReferenceError: Subscription is not defined at
Module.zUnb (SubjectSubscription.js.pre-build-optimizer.js:7)
at f (bootstrap:78)
at Object.0 (main.b3059a947fcd0e8a64b5.js:1)
at f (bootstrap:78)
at t (bootstrap:45)
at Array.r [as push] (bootstrap:32)
at main.b3059a947fcd0e8a64b5.js:1
Update 2 : With ng serve --prod sourceMap=true command this extra warning is comming :-
Is the warning has something to do with my error. Also i have checked for subscription in my code their doesn't seems any error.
I found the answer to this problem in Luciano comment.
Angular6 - Prod build fails to access
Basically it was Rxjs package problem in package.json.
May be this may help someone. Thankyou.

How to use angular-card

I want to use im my angularJS project : https://github.com/gavruk/angular-card/blob/master/src/card.js
but when i do everyhing like showed in documentation i get:
libraries.js:30369 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module myApp.controllers due to:
Error: [$injector:modulerr] Failed to instantiate module angular-card due to:
Error: [$injector:nomod] Module 'angular-card' 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.

Getting error in building project in using bower, nodejs, grunt

I have created project using nodejs,
bower packages are installed but not added the tags in index.html, so I have manually inserted the script tags like ../bower_components
so I am getting this error
http://localhost:9000/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
2016-05-24 18:11:04.419 http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js Failed to load resource: the server responded with a status of 404 (Not Found)
2016-05-24 18:11:04.581 angular.js:4587 Uncaught Error: [$injector:modulerr] Failed to instantiate module bulbulPortal20App due to:
Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to:
Error: [$injector:nomod] Module 'ui.bootstrap' 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.
to avoid these errors in future what I have to do?

Ember 2.0 upgrade errors: Unexpected strict mode reserved word & handlebars precompile error

I'm trying to upgrade an ember-rails app from ember v1.13 to v2.0. The app loads and templates render in ember 1.13 and there are no deprecations coming through to the console. When I bump the version to 2.0.0 (through the ember-source gem), the app doesn't seem to load and no templates are rendered. Instead, this error is in the JS console:
Uncaught Error: ExecJS::RuntimeError: SyntaxError: Unexpected strict mode reserved word
If I refresh the page, suddenly I'm hit with a handlebars precompile error:
Uncaught Error: Barber::PrecompilerError: Pre compilation failed for:
(prints out file contents)
Compiler said: ReferenceError: Handlebars is not defined
Any thoughts on what could be the cause of this? Any input would be greatly appreciated, as I've been stuck on this for hours!!!

browserify 'Error: Cannot find module' in trying to fix 'Uncaught reference error: require is not defined'

I am having a very similar, or almost exact, issue to #RachelD from this thread (Node.js + Angular = Uncaught ReferenceError: require is not defined) regarding the Uncaught reference error. However, when I run my 'browserify' command as stated in the directions here (https://github.com/substack/node-browserify) and exactly as shown below (I included my directory as well for reference)...
myname#compname:~/workspace/MyApp $ browserify /app/scripts/controllers/main.js > bundle.js
I am getting a 'Cannot find module' error
Error: Cannot find module '/app/scripts/controllers/main.js' from '/Users/myname/workspace/MyApp'
at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:35:25
at load (/usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:53:43)
at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:59:22
at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:107:15)
How do I get past this error?
You are using an absolute path: /app/scripts/controllers/main.js. You probably want app/scripts/controllers/main.js.

Categories