I am trying to debug Angular app with Angular DevTools for Chrome Extension, but I am getting an error when I try to use it:
We detected an application built with production configuration. Angular DevTools only supports development builds.
Can I revert project to dev mode?

You may be missing a development configuration for your application.
In your angular.json navigate to architect -> build -> configurations and add these lines, below the definition of the production build:
"configurations": {
"production": {
// already there!
},
"development": { // this is new!
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
And to run the build in development mode just type the next command: ng build --configuration development.
I had all of those settings and configurations in place in angular.json.
For me, the problem was the following:
main.ts:
if (environment.production) {
enableProdMode(); // <-- here
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
And apparently, I changed the production property of my environment.ts file at some point in the past, setting production in there to true, even in development mode.
Changing it back to false finally resolved this for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With