rockyourcode

Subscribe
Archives
December 14, 2021

rockyourcode: “How to Think” by André Staltz – Uphill Conf 2019, TIL: Angular Configuration Detected Running in Production Mode

Hello 👋! Thanks for subscribing.

Here are the articles from last week:

“How to Think” by André Staltz – Uphill Conf 2019

Published on: 2021-12-12

tags: Lab, Notes

Here are short bullet points on the talk How to Think.

André Staltz - How to Think - Uphill Conf 2019

  • mind map as a data structure
  • thinking as an algorithm
  • have a structure for your thoughts
  • humans imitate each other
  • humans have limited working memory
  • avoid blindly imitating each other, give new ideas at least 10 seconds to think about
  • acknowledge your feelings
  • improve your memory with tools (put your thoughts on paper)
  • debugging = investigating
  • deduction
  • git bisect
  • induction: make a good guess
  • backtracking: question everything
  • brainstorming
  • documentation: code that instruct humans
  • think slowly and methodically
  • be aware of your biases, feelings, and limitations
  • specialize, but keep learning

Links

  • André Staltz - How to Think - Uphill Conf 2019

TIL: Angular Configuration Detected Running in Production Mode

Published on: 2021-12-08

tags: Angular, TIL

How to fix development mode for Angular

The Problem

My Angular 12 application was quite slow when I started it with ng serve. When I open the Angular DevTools I get the error:

We detected an application built with production configuration. Angular DevTools only supports development builds.

The Solution

You’ll need an extra configuration for the development build if your angular.json doesn’t have it. That’s the case if you migrated from an earlier Angular version to v12 or later.

Adjust angular.json:

Add the development options in the architect section under configurations:

I disabled all optimizations for the development mode, but you can fine-tune them if you like. See the documentation for details.

You’ll also need a browserTarget for your configuration:

{
// previous configuration
  "projects": {
    "your-project-name": {
    // some options
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
          // options outcommented
          },
          /* add the development configuration with disabled
          optimizations */
          "configurations": {
            "development": {
              "optimization": false
            },
            "production": {
            // production options
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "your-project-name:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "your-project-name:build:production"
            },
            /* add a new development configuration
            with a `browserTarget` */
            "development": {
              "browserTarget": "your-project-name:build:development"
            }
          },
          /* add the development mode
          as default configuration */
          "defaultConfiguration": "development"
        },
      }
    }
  },
  "defaultProject": "your-project-name"
}

That should do the trick.

Links

  • Angular always detected running in production mode
  • Angular Optimization configuration
  • Angular - Configuration is not set in the workspace

Thank you for reading my blog.

Don’t hesitate to reach out via email or Twitter!

Don't miss what's next. Subscribe to rockyourcode:
GitHub X
Powered by Buttondown, the easiest way to start and grow your newsletter.