You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you export a (barrel) from the default index.ts it is generally valid to omit the index and only reference the folder like so: export * from 'components/feature' (does not work and fails silently)
However, ng seems to ignore the index.ts inside. As a workaround it is possible to specify the file name explicitly (as you would for any other file than index.ts): export * from 'components/feature/index' (works)
The log given by the failure.
The failure is silent and only obvious after you check the generated metadata.json after compilation in the dist folder. It will basically just ignore all the metadata of exported classes and thus AOT compilation will break for projects consuming the library.
Desired functionality.
ng should support export * from 'components/feature' and implicitly use the index.ts inside.
If that is not desired, then at least throw an error at compile time. This wasted about a week of our time so it would be great to save others from the same fate. 🥇
I was under the impression that ngc is responsible for creating the metadata.json as it is an Angular specific thing. And since rollup comes into play later down the road, I was assuming ngc is the issue.
Angular CLI and ngc are not the same thing though, they are quite different. The package for ngc is @angular/compiler-cli, and the repository where you can submit issues for that package is https://github.com/angular/angular.
Bug Report
Versions.
Repro steps.
If you export a (barrel) from the default
index.ts
it is generally valid to omit the index and only reference the folder like so:export * from 'components/feature'
(does not work and fails silently)However, ng seems to ignore the index.ts inside. As a workaround it is possible to specify the file name explicitly (as you would for any other file than
index.ts
):export * from 'components/feature/index'
(works)The log given by the failure.
The failure is silent and only obvious after you check the generated metadata.json after compilation in the dist folder. It will basically just ignore all the metadata of exported classes and thus AOT compilation will break for projects consuming the library.
Desired functionality.
ng should support
export * from 'components/feature'
and implicitly use the index.ts inside.If that is not desired, then at least throw an error at compile time. This wasted about a week of our time so it would be great to save others from the same fate. 🥇
Mention any other details that might be useful.
Origin: #7384
The text was updated successfully, but these errors were encountered: