Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Angular always detected running in production mode #916

Open
AntonyChiossi opened this issue Sep 3, 2021 · 3 comments
Open

Angular always detected running in production mode #916

AntonyChiossi opened this issue Sep 3, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@AntonyChiossi
Copy link

Hi this issue is similar to #868.

angular.json (cant share it all)

architect.build.options:

"options":  {
            ...
            "vendorChunk": true,
            "extractLicenses": false,
            "buildOptimizer": false,
            "sourceMap": true,
            "optimization": false,
            "namedChunks": true,
           "webWorkerTsConfig": "tsconfig.worker.json"
}

architect.conficurations.dev:

I tried with and without default.

 ...
"dev": {
              "budgets": [
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ]
}
 ...
 ...
"dev": {
              "budgets": [
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
              "vendorChunk": true,
              "extractLicenses": false,
              "buildOptimizer": false,
              "sourceMap": true,
              "optimization": false,
              "namedChunks": true
}
 ...

By launching ng serve (i have to use ssl) with and without the conf:

ng serve --ssl
ng serve --configuration dev --ssl

the result is the same:
image

ng version

Angular CLI: 12.2.1
Node: 14.17.1
Package Manager: npm 6.14.13
OS: linux x64

Angular: 12.2.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.1
@angular-devkit/build-angular   12.2.1
@angular-devkit/core            12.2.1
@angular-devkit/schematics      12.2.1
@schematics/angular             12.2.1
rxjs                            6.5.5
typescript                      4.2.4
@AntonyChiossi AntonyChiossi added the bug Something isn't working label Sep 3, 2021
@mgechev
Copy link
Contributor

mgechev commented Sep 7, 2021

@AntonyChiossi would you share a minimal reproduction? The shared information would not be sufficient to see what's going on.

@leongrin
Copy link

leongrin commented Oct 6, 2021

I am having the same issue. Angular Dev Tools is not working on my development environment, and I am using Angular 12.2.0. I am attaching a screenshot of the issue.
image

@sebastiencl
Copy link

sebastiencl commented Oct 19, 2021

Same issue since I update my project from 11.x to 12.2.x. I'm not building in prod configuration, but my devtools detect a production build.

EDIT :
I fixed this issue. In angular.json, juste specify "optimization": false in your dev build options. Before Angular 12, it wasn't mandatory. Don't forget to set it to true in your production build.

see : https://angular.io/guide/workspace-config#optimization-configuration

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants