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.

ivy-ngcc (8.0.0-beta.11): ng2-dragula.js.__ivy_ngcc_bak with an ngcc back up file, which is disallowed

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli (ivy-ngcc)

Description

npx ivy-ngcc -l debug execution ends up with the following output:

Compiling @angular/core : fesm2015 as esm2015
Compiling @angular/core : fesm5 as esm5
Compiling @angular/core : esm2015 as esm2015
Compiling @angular/core : esm5 as esm5
Compiling @angular/common : fesm2015 as esm2015
Compiling @angular/common : fesm5 as esm5
Compiling @angular/common : esm2015 as esm2015
Compiling @angular/common : esm5 as esm5
Compiling @angular/common/http : fesm2015 as esm2015
Compiling @angular/common/http : fesm5 as esm5
Compiling @angular/common/http : esm2015 as esm2015
Compiling @angular/common/http : esm5 as esm5
Compiling @angular/common/http/testing : fesm2015 as esm2015
Compiling @angular/common/http/testing : fesm5 as esm5
Compiling @angular/common/http/testing : esm2015 as esm2015
Compiling @angular/common/http/testing : esm5 as esm5
Compiling @angular/common/testing : fesm2015 as esm2015
Compiling @angular/common/testing : fesm5 as esm5
Compiling @angular/common/testing : esm2015 as esm2015
Compiling @angular/common/testing : esm5 as esm5
Compiling @angular/core/testing : fesm2015 as esm2015
Compiling @angular/core/testing : fesm5 as esm5
Compiling @angular/core/testing : esm2015 as esm2015
Compiling @angular/core/testing : esm5 as esm5
Compiling @angular/platform-browser : fesm2015 as esm2015
Compiling @angular/platform-browser : fesm5 as esm5
Compiling @angular/platform-browser : esm2015 as esm2015
Compiling @angular/platform-browser : esm5 as esm5
Compiling @angular/platform-browser-dynamic : fesm2015 as esm2015
Compiling @angular/platform-browser-dynamic : fesm5 as esm5
Compiling @angular/platform-browser-dynamic : esm2015 as esm2015
Compiling @angular/platform-browser-dynamic : esm5 as esm5
Compiling @angular/platform-browser/testing : fesm2015 as esm2015
Compiling @angular/platform-browser/testing : fesm5 as esm5
Compiling @angular/platform-browser/testing : esm2015 as esm2015
Compiling @angular/platform-browser/testing : esm5 as esm5
Compiling @angular/compiler/testing : fesm2015 as esm2015
Compiling @angular/compiler/testing : fesm5 as esm5
Compiling @angular/compiler/testing : esm2015 as esm2015
Compiling @angular/compiler/testing : esm5 as esm5
Compiling @angular/platform-browser-dynamic/testing : fesm2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : fesm5 as esm5
Compiling @angular/platform-browser-dynamic/testing : esm2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : esm5 as esm5
Compiling ng2-dragula : fesm2015 as esm2015
Compiling ng2-dragula : fesm5 as esm5
Compiling ng2-dragula : esm2015 as esm2015
Compiling ng2-dragula : esm5 as esm5
Compiling ng2-dragula : fesm2015 as esm2015
Error: Tried to overwrite /dev/temp/ivy-ngss-duplicated-entries/node_modules/ng2-dragula/dist/fesm2015/ng2-dragula.js.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
    at InPlaceFileWriter.writeFileAndBackup (/dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/src/writing/in_place_file_writer.js:37:23)
    at /dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/src/writing/in_place_file_writer.js:31:69
    at Array.forEach (<anonymous>)
    at InPlaceFileWriter.writeBundle (/dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/src/writing/in_place_file_writer.js:31:30)
    at /dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/src/main.js:95:36
    at Array.forEach (<anonymous>)
    at Object.mainNgcc (/dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/src/main.js:67:21)
    at /dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/main-ngcc.js:60:20
    at /dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/main-ngcc.js:4:17
    at Object.<anonymous> (/dev/temp/ivy-ngss-duplicated-entries/node_modules/@angular/compiler-cli/ngcc/main-ngcc.js:10:3)

πŸ”¬ Minimal Reproduction

  1. create package.json:
{
  "name": "ivy-ngss-duplicated-entries",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "8.0.0-beta.11",
    "@angular/compiler": "8.0.0-beta.11",
    "@angular/core": "8.0.0-beta.11",
    "@angular/platform-browser": "8.0.0-beta.11",
    "@angular/platform-browser-dynamic": "8.0.0-beta.11",
    "rxjs": "6.4.0",
    "zone.js": "0.9.0"
  },
  "devDependencies": {
    "@angular/compiler-cli": "8.0.0-beta.11",
    "@types/node": "8.9.4",
    "ng2-dragula": "2.1.1",
    "typescript": "~3.3.3333"
  }
}
  1. install dependencies (yarn / npm i)
  2. execute npx ivy-ngcc -l debug

Anything else relevant?

So it looks like entryPoints array includes duplicated ng2-dragula entries (see 2 last items of the array).

CC @petebacondarwin

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
vladimirycommented, Apr 5, 2019

I just placed related issue here https://github.com/valor-software/ng2-dragula/issues/951 Let’s see maybe package.json has been shipped twice without specific intention.

3reactions
petebacondarwincommented, Apr 4, 2019

This is due to the ng2-dragula package unfortunately having two copies of package.json and ng2-dragular.metadata.json which both point to the same files. One is at the root of the package (see https://unpkg.com/ng2-dragula@2.1.1/) and one is in the dist folder (see https://unpkg.com/ng2-dragula@2.1.1/dist/). This makes the ng2-dragula/dist an Angular entry-point as well.

Because they both point to the same source files, ngcc is trying to compile the same source twice.

I think the right solution would be to ask ng2-dragula to release a version that only has one lot of package.json files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling __ivy_ngcc_bak compiler errors - devioblog
__ivy_ngcc_bak with an ngcc back up file, which is disallowed. Well, I checked, and indeed, the file existed. Let's delete the *.
Read more >
ng2-dragula | Simple drag and drop with ... - Valor Software
Drags don't trigger click events. Clicks don't end up in a drag, either. This is useful if you have elements that can be...
Read more >
ng2-dragula in angular7 failed to compile - Stack Overflow
Show activity on this post. Using a default startup Angular-Cli 7 project and following the steps as described here: https://github.com/valor-Β ...
Read more >
ng2-dragula - npm
Simple drag and drop with dragula. Latest version: 3.2.0, last published: 15 days ago. Start using ng2-dragula in your project by runningΒ ...
Read more >
Drag & Drop in Your Angular Apps With ng2-dragula
ng2-dragula is an Angular 2+ wrapper for the popular Dragula drag ... JavaScript library for drag & drop, and ng2-dragula is a wrapper...
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