enableProdMode console message is too mysterious
See original GitHub issueI got this message in the console:
Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
Curious, I behaved literally and typed this into the console:
enableProdMode();
At which point I was greeted with this error:
VM1256:2 Uncaught ReferenceError: enableProdMode is not defined(…)(anonymous function) @ VM1256:2
InjectedScript._evaluateOn @ VM1126:875
InjectedScript._evaluateAndWrap @ VM1126:808
InjectedScript.evaluate @ VM1126:664
This console message should link to docs explaining what enableProdMode is and an example of how exactly to enable it. For example, something like this would have been much clearer (not sure if this is how you do it exactly):
import {enableProdMode} from "angular2/core";
enableProdMode();
Issue Analytics
- State:
- Created 8 years ago
- Reactions:54
- Comments:26 (4 by maintainers)
Top Results From Across the Web
Enabling production mode in angular 2 using ... - Stack Overflow
Call enableProdMode() to enable the production mode.". why it is showing in console don't know . Please tell me the steps to resolve...
Read more >enableProdMode - Angular
enableProdMode link Disable Angular's development mode, which turns off assertions and other checks within the framework.
Read more >Workflow of Angular - Medium
So, enableProdMode() is not get executed as the condition failed. To verify that, I have given a console message in the else block...
Read more >Site Cannot be installed: No Matching Service Worker expected
Let me show one of the generic issue which I faced. This message is self explanatory as the chrome couldn't detect service worker,...
Read more >Applying Universal Schematics - The newline Guide to ...
After applying the schematics, you should see the summary output of what has been ... Both solutions are watching your project for changes,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It also works when done on the boot.ts file. Mine now looks like this:
But now instead of
Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
i’m gettingAngular 2 is running in the production mode. Call enableDevMode() to enable the development mode.
Surely in a production mode there shouldn’t be any messages, specifically given that one has to write code to enable production mode.
Guys just write this code on the bootstraped Component and make sure it is not inside any class or constructor just one below the other, it worked for me.!
hope this helps!