-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AoT] Bundled metadata does not reflect metadata lowering // [PREV: Packaged library is not working in AOT mode] #382
Comments
I am having the same issue |
@bdoucette Good. Do you like to share your solution? |
Uploaded the https://gist.github.com/dherges/762563c1bf3f4448370110072a1c4656 Does someone the where the issue is? Is it this? packagr: "origins": {
"SelectableListModule": ".\/src\/app\/selectable-list\/selectable-list-module",
"\u0275a": ".\/src\/app\/selectable-list\/directive\/selectable-list\/selectable-list.directive",
"SelectableListDirective": ".\/src\/app\/selectable-list\/directive\/selectable-list\/selectable-list.directive",
"\u0275b": ".\/src\/app\/selectable-list\/directive\/selectable-item\/selectable-item.directive"
} ngc:
|
Hello @dherges I pinned my version of ng-packagr to Do you have an official issue where you could link all appearances of this error, Did you already had some time to dive into the problem and have a clue what might cause this? And thank you so much for this tool and all the conventions you guys worked out. That's so much better than maintaining your own packaging madness 🙌 |
Hi @georgiee, thanks for putting a good repro up! That helps to give you some feedback. In your case... In the repro at https://github.com/georgiee/ng-packagr-foos, the bundled metadata json ( I guess this issue is angular/angular#21082 - let's ask |
Hey @dherges, |
Hi, --- a/src/app/selectable-list/directive/selectable-list/selectable-list.directive.ts
+++ b/src/app/selectable-list/directive/selectable-list/selectable-list.directive.ts
@@ -21,12 +21,14 @@ export enum Mode {
both = 'Single and multiple (press activated)',
}
+export const SERVICE = new SelectableListService();
+
@Directive({
selector: '[appSelectableList]',
providers: [
{
provide: 'selectable-list-service',
- useValue: new SelectableListService(),
+ useValue: SERVICE,
}
],
}) I don't know if that could be applicable to any of your use cases. |
Hello @dherges, See this? Go from
to
and this will fix the metadata issue not only in this small example but also in my real library 🙏 Hope this enables you to help people coming here with this error. Source of my knowledge: IGNORE the following unrelated error: Original question I had:
|
Hi there, regarding TypeScript barrels, there are some known issues, see #195. I cannot say why when and how the issues come up. In general, my personal recommendation is to not use TypeScript barrels. Regarding the |
I'd like to emphasize on the following quot from the above blog post:
If you're intending to provide a module in different "feature-configurations", my recommendation is to do so by |
In my case, I had this error crop up when I was exporting a service that used an InjectionToken and a factory. I had to explicitly export the injection token constant with the module and factory in the library's main index.ts in order to get things to work. |
This issue has been automatically locked due to inactivity. |
Type of Issue
Description
I get the following error if I try to use my library in another project with
ng serve --aot
:How To Reproduce
Just use this repo to build the package and import it in a new angularcli project:
https://github.com/darkbasic/ngx-selectable-list/tree/packagr
If you want to see how exactly I use it have a look at this repo:
https://github.com/Urigo/whatsapp-client-angularcli-material/tree/master-step6
Precisely look at
Step 6.1
andStep 6.2
in the commit history.Expected Behaviour
Should be able to use my library in AOT mode.
Version Information
https://github.com/darkbasic/ngx-selectable-list/blob/packagr/package.json
The text was updated successfully, but these errors were encountered: