Skip to content

ERROR in Tried to overwrite .__ivy_ngcc_bak with an ngcc back up file, which is disallowed. #19635

Description

@rkreienbuehl

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

I don't know if this worked in previous versions

Description

When running ng serve on a workspace project with libraries and I use ng build <lib-name> --prod --watch to constantly build the library on changes, after the second change in the same library file, I get the following error:
ERROR in Tried to overwrite ....d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.

🔬 Minimal Reproduction

  1. Create angular workspace project
  2. Create new library inside the project
  3. Use the library in the project
  4. Start library build with --watch
  5. Run ng serve
  6. Change something inside a library file and save -> server detects the change in dist folder and recompiles
  7. Change something in the same library file -> server detects the change in dist folder and recompiles -> ERROR

🔥 Exception or Error

After first change:


Date: 2020-12-16T08:54:11.584Z - Hash: 5d74c1474915b4072a91
13 unchanged chunks

Time: 1872ms
: Compiled successfully.

Date: 2020-12-16T08:54:14.572Z - Hash: 5d74c1474915b4072a91
13 unchanged chunks

Time: 2657ms
: Compiled successfully.

After second change:


Compiling @apmatic/apm-ui-core : es2015 as esm2015

Date: 2020-12-16T08:55:23.790Z - Hash: b8f3181cb1e82c5839c5
13 unchanged chunks

Time: 3367ms

ERROR in Tried to overwrite dist/....service.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
0% compiling
Compiling @apmatic/apm-ui-core : es2015 as esm2015

Date: 2020-12-16T08:55:28.463Z - Hash: b8f3181cb1e82c5839c5
13 unchanged chunks

Time: 4270ms

ERROR in Tried to overwrite dist/....service.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
0% compiling

This leads in an endless loop of building.

🌍 Your Environment


Angular CLI: 9.1.3
Node: 12.19.0
OS: linux x64

Angular: 9.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.7
@angular-devkit/build-angular      0.900.7
@angular-devkit/build-ng-packagr   0.900.7
@angular-devkit/build-optimizer    0.900.7
@angular-devkit/build-webpack      0.900.7
@angular-devkit/core               9.0.7
@angular-devkit/schematics         9.1.3
@angular/cdk                       9.2.1
@angular/flex-layout               9.0.0-beta.31
@angular/material                  9.2.1
@angular/material-moment-adapter   9.2.1
@ngtools/webpack                   9.0.7
@schematics/angular                9.1.3
@schematics/update                 0.901.3
ng-packagr                         9.1.1
rxjs                               6.5.5
typescript                         3.7.5
webpack                            4.41.2

Anything else relevant?
The same happens on Windows as well. Also I found an article in an other issue describing the same behavior:
error when compiling with ivy ngcc (Teradata/covalent)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions