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: NGCC failed" when using `"somepackage": "file:app/somepackage"` in package.json

See original GitHub issue

🐞 bug report

Affected Package

@ngtools/webpack@10.1.0 @angular/compiler@10.1.0 @angular/compiler-cli@10.1.0

Now I have version 10.1.1, but bug is still there.

Is this a regression?

Yes, the previous version in which this bug was not present was: 10.0.14

Description

I am using custom Webpack configuration as I am coming from NgUpgrade world. I am using in my work project multiple git submodules. I am linking their package.json via "somepackage": "file:app/somepackage" format (see in my github repo package.json).

🔬 Minimal Reproduction

https://github.com/kmaraz/ngcc-failed

Just install packages via yarn and then build project with Ivy: yarn run failsdev. Note: when you remove somepackage from package.json, run yarn, then everything works as expected.

🔥 Exception or Error

100% times build just hangs, sometimes when it hangs and I terminate it, I get Error: NGCC failed.

🌍 Your Environment

Angular Version:


Angular packages in version 10.1.1

Anything else relevant? I am using Windows Subsystem for Linux.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kmarazcommented, Sep 19, 2020

Oh, wow! So, based on what you said @gkalpak, I have moved my project to native WSL2 home directory and NGCC time is now down to 30seconds 😮. This is a completely different world to me now.

I am really grateful to all of you guys with helping me to debug my problem. I have learned multiple things, like debugging nodejs projects, or about filesystems and how they cooperate.

So let me thank you again!

1reaction
petebacondarwincommented, Sep 18, 2020

--use-program-dependencies will parse the imports in your project to work out what packages are actually being used. Based on that it will then determine which libraries/entry-points need processing.

I note that in your tsconfig.json you are using exclude to specify which files to load. I suspect that the package.json/tsconfig.json in the app/somepackage folder is being picked up by TS as something to compile but the main file in that package does not exist.

Can you try running ngcc directly but including that --use-program-dependencies option. This may give a more specific error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular ng serve produces Error: NGCC failed - Stack Overflow
I just updated angular cli, material and core, and other modules needed to my project, then updated npm and typescript package, and that's...
Read more >
An unhandled exception occurred NGCC failed 2020 - YouTube
Dear Allafter Uninstall angular font-awesome from the package. json, kindly close the package. json opened file then restart the server ex: ng ...
Read more >
help with webpack error : r/Angular2 - Reddit
help with webpack error. I was trying to covert my project ... throw new Error(errorMessage + `NGCC failed${errorMessage ? ... package.json.
Read more >
Fails to build with NGCC | Angular - EJ 2 Forums | Syncfusion
I'm getting errors at runtime if I ignore ngcc build with the date time picker. ... the postinstall as like below in your...
Read more >
error: failed to initialize angular compilation - ngcc failed.
log" for further details. I just updated angular cli, material and core, and other modules needed to my project, then updated npm and...
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