-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Ivy: Debug assert: importing a Reference to non-declaration? #34837
Comments
No need for a repro, I see what's going on here! It's indeed a bug introduced in #34021. |
In angular#34021 the ngtsc compiler gained the ability to emit type parameter constraints, which would generate imports for any type reference that is used within the constraint. However, the `AbsoluteModuleStrategy` reference emitter strategy did not consider interface declarations as a valid declaration it can generate an import for, throwing an error instead. This commit fixes the issue by including interface declarations in the logic that determines whether something is a declaration. Fixes angular#34837
To workaround the issue you could change the export type IdInterface_Ng34837 = IdInterface;
export class SimpleTableComponent<T extends IdInterface_Ng34837 > Introducing the local type alias prevents the type emitter from kicking in, avoiding the issue. |
@JoostK wonderful, thanks! |
In angular#34021 the ngtsc compiler gained the ability to emit type parameter constraints, which would generate imports for any type reference that is used within the constraint. However, the `AbsoluteModuleStrategy` reference emitter strategy did not consider interface declarations as a valid declaration it can generate an import for, throwing an error instead. This commit fixes the issue by including interface declarations in the logic that determines whether something is a declaration. Fixes angular#34837
) In #34021 the ngtsc compiler gained the ability to emit type parameter constraints, which would generate imports for any type reference that is used within the constraint. However, the `AbsoluteModuleStrategy` reference emitter strategy did not consider interface declarations as a valid declaration it can generate an import for, throwing an error instead. This commit fixes the issue by including interface declarations in the logic that determines whether something is a declaration. Fixes #34837 PR Close #34849
This error happened for me for 9.0.0-rc.14 |
@surenrao The fix will be part of the next release, it just missed rc.14 |
…ular#34849) In angular#34021 the ngtsc compiler gained the ability to emit type parameter constraints, which would generate imports for any type reference that is used within the constraint. However, the `AbsoluteModuleStrategy` reference emitter strategy did not consider interface declarations as a valid declaration it can generate an import for, throwing an error instead. This commit fixes the issue by including interface declarations in the logic that determines whether something is a declaration. Fixes angular#34837 PR Close angular#34849
…ular#34849) In angular#34021 the ngtsc compiler gained the ability to emit type parameter constraints, which would generate imports for any type reference that is used within the constraint. However, the `AbsoluteModuleStrategy` reference emitter strategy did not consider interface declarations as a valid declaration it can generate an import for, throwing an error instead. This commit fixes the issue by including interface declarations in the logic that determines whether something is a declaration. Fixes angular#34837 PR Close angular#34849
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Is this a regression?
Yes, worked in non-ivy.
Description
When importing and using a third party file that contains only interfaces/types I get an error when building in production mode. In development mode everything works fine.
Debug assert: importing a Reference to non-declaration?
angular/packages/compiler-cli/src/ngtsc/imports/src/emitter.ts
Line 131 in 0b1e34d
🔬 Minimal Reproduction
I still work on that. I have it in a rather big code base, so this might take some time.
🔥 Exception or Error
When I print all the arguments via
in that method I get:
As we can see the
IdInterface
is a interface only. This is used in following component like so:🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: