question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in production build after update to Angular 8

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/....

Is this a regression?

Yes, It occurred after update to Angular 8. I didn’t change any environments files, or configuration. Previously I used Angular 7.

Description

Production build fails using Angular 8. Here is my configuration: "my-prod": { "optimization": true, "outputHashing": "all", "sourceMap": true, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.my-prod.ts" } ] }, I use command to build: ng build --prod --configuration=my-prod

🔥 Exception or Error


ERROR in src/__ng_typecheck__.ts(334,62): error TS2344: Type '"enabled" | "minRows" | "maxRows" | "cdkAutosizeMinRows" | "cdkAutosizeMaxRows" | "matAutosizeMinRows" | "matAutosizeMaxRows" | "matAutosize" | "matTextareaAutosize"' does not satisfy the constraint '"ngOnDestroy" | "ngDoCheck" | "enabled" | "reset" | "ngAfterViewInit" | "minRows" | "maxRows" | "matAutosizeMinRows" | "matAutosizeMaxRows" | "matAutosize" | "matTextareaAutosize" | "_setMinHeight" | "_setMaxHeight" | "resizeToFitContent" | "_noopInputHandler"'.
  Type '"cdkAutosizeMinRows"' is not assignable to type '"ngOnDestroy" | "ngDoCheck" | "enabled" | "reset" | "ngAfterViewInit" | "minRows" | "maxRows" | "matAutosizeMinRows" | "matAutosizeMaxRows" | "matAutosize" | "matTextareaAutosize" | "_setMinHeight" | "_setMaxHeight" | "resizeToFitContent" | "_noopInputHandler"'.

🌍 Your Environment

Angular Version:


Angular CLI: 8.0.1
Node: 12.4.0
OS: darwin x64
Angular: 8.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        0.6.8
@angular/cli                      8.0.1
@angular/http                     8.0.0-beta.10
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
MaciejWWojcikcommented, Jun 6, 2019

@santoshyadav198613 Hello 😃

Wow, the 4th point was actually very very helpful. I had enabled the Ivy 😦 I switched this off and now my build is working 🎉

Thanks very much!

3reactions
trotylcommented, Jun 6, 2019

I only want to say, that my build was working in Angular 7

The template type-checking is a new feature added in Ivy recently which being released at version 8. Also, template type-checking is designed to check your template usage, and break the build on any violation, a type-error is basically a BUG in your app (as long as what reported is correct and expected). Ivy is only designed for preview purpose now, that mean any real project should not use Ivy (except for testing compatibility).

If you use Ivy in any real project (even in v7 or before?), you’re putting your project on your own risk.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to load module script: The server responded with a non ...
After upgrading to Angular 8, production builds can't load: Failed to load module script: The server responded with a non-JavaScript MIME type of...
Read more >
Identify and Fix Build and Deployment Errors in Your Angular ...
In this guide, you will learn how to spot some of the most common build and deployment errors and how to resolve them...
Read more >
Build errors after Upgrading from Angular 8 to 9 - Stack Overflow
Try that: rollback all the changes; remove node_modules folder; npm i / yarn; npm install @angular/cli -g; ng update @angular/cli ...
Read more >
Read your production Angular Errors like a pro - Medium
This is a TypeError thrown from the Angular application which can be seen in the Chrome Developer Tools console tab. Let's analyze it...
Read more >
NG0100: Expression has changed after it was checked - Angular
Angular throws an ExpressionChangedAfterItHasBeenCheckedError when an expression value has been changed after change detection has completed. Angular only ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found