Closed vthinkxie closed 3 years ago
I have debugged this build and it appears that the problem is actually that the entryFile path in ng-package.json is incorrect. It should have an extension (i.e. "./public_api.ts"
). See https://github.com/NG-ZORRO/ng-zorro-antd/blob/df03ffb7f045271056e03e4659f7e845003c3bde/components/ng-package.json#L6
Unfortunately the error is not picked up until much later when the compiler tries to load the entry-point and thinks that there is none there - ngtsc (the ivy compiler) filters out input files that do not end with .ts
. See https://github.com/angular/angular/blob/7c161e167907cea92f25df192e0dde789e0cfd43/packages/compiler-cli/src/ngtsc/core/src/host.ts#L172-L178
So on the ng-zorro-antd
side the fix is to change the path in that file.
(Also it might be worth removing this includes as well: https://github.com/NG-ZORRO/ng-zorro-antd/blob/df03ffb7f045271056e03e4659f7e845003c3bde/components/tsconfig.lib.json#L26)
On our side we need to:
flatModuleOutFile
option in Ivy builds, since I understand that it was only designed to generate a flat metadata.json
file, which is not needed for Ivy builds. <-- cc @alxhub and @JoostK Hi
Everything works fine with angular 11.1.1, thanks a lot
Thanks for the update. I see in your referenced PR that you are removing the files
property from tsconfig.json. I think that is what solves the problem rather than any change in 11.1.1.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
π bug report
Affected Package
unknow
Is this a regression?
no
Description
throw below error when building ivy lib with the configuration
https://github.com/mgechev/ivy-library-distribution-demo
π¬ Minimal Reproduction
Pull Request: https://github.com/NG-ZORRO/ng-zorro-antd/pull/6362
Exception: https://dev.azure.com/ng-zorro/NG-ZORRO/_build/results?buildId=3206&view=logs&j=8680be89-378c-5901-27b8-79bf589da266&t=7cc10bac-49f7-5748-d4ee-64732cd3a79d
π₯ Exception or Error
π Your Environment
Angular Version:
Anything else relevant?