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.

Angular library build error with enableIvy=false

See original GitHub issue

Type of Issue

[x ] Bug Report
[ ] Feature Request

Description

image

In my project , I set up “enableIvy”: false would be error. If I replacing “enableIvy”: false with “compilationMode”: “partial” , it can work normally, but I don’t know why

How To Reproduce

my test project: https://github.com/yinshuxun/test-ngpackager

git clone https://github.com/yinshuxun/test-ngpackager.git
yarn 
yarn build

Expected Behaviour

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            12.2.0
@angular/compiler:     12.2.1
rollup:                2.56.2
typescript:            4.3.5

Please include all version numbers that might be relevant, e.g. third-party libraries

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JounQincommented, Aug 20, 2021

That’s our internal package, so the whole source code can not be provided.

That’s OK you won’t help, let’s wait for other active maintainers.

Besides, we’ve already found a workaround by a custom tsconfig like following as Angular document.

{
  "angularCompilerOptions": {
    "enableIvy": true,
    "compilationMode": "partial",
    "strictMetadataEmit": false
  }
}
1reaction
SchnWaltercommented, Aug 20, 2021

@yinshuxun, that is not a reproduction, you are only re-exporting a closed source library.

And that one has quite a few dependencies, some of which are Angular libraries. You should add a 2nd minimal example library that can trigger the same issue when being re-exported, otherwise we can’t really help you with anything. We need to see the full code and you should work on providing a minimal reproduction, we can’t and won’t review tens of libraries for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiling an Angular 9 library with enableIvy: false gives an ...
The problem was that public-api.ts in otherlib was exporting the folder, not the barrel file (index). So I changed export * from "./lib";....
Read more >
Upcoming improvements to Angular library distribution
ngcc is our way to compile View Engine libraries so that Ivy ... which allows us to remove the --enableIvy flag and deprecate...
Read more >
Understanding Angular Ivy Library Compilation | lacolaco/tech
Here is the main topic. First, let's look at compiling libraries with enableIvy: false , which is the current recommended setting for v11....
Read more >
Angular Ivy
CLI commands run ngcc as needed when performing an Angular build. ... The following example shows how to set the enableIvy option to...
Read more >
Newest 'angular-ivy' Questions - Stack Overflow
Angular app build time is taking too long after importing an library ... set in an angular library: "angularCompilerOptions": { "enableIvy": false }...
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