-
Hi together, this issue seems to be related to The following error occurs, if I use
readPaged(query: PagedQuery) {
return this.useQuery({
queryKey: [this.key, query],
queryFn: () => this.http.get<Paged<...>>(`${this.endpoint}?${query.buildQueryString()}`)
});
} This compiler error, does not break the build, but all type-information are lost. WorkaroundI could write an import to reference
What are your thoughts on this? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
Can you provide a full list of dependencies that you use on your Project? |
Beta Was this translation helpful? Give feedback.
-
My best guess would be that TS is asking you for a type annotation on your I already gave advide on how to unwrap the token in here: #98 (comment) class TestComponent {
private readonly useQuery: UnwrapInjectionToken<typeof UseQuery> = inject(UseQuery);
readPaged(query: PagedQuery): ReturnType<typeof this.useQuery<Paged<...>>> {
return this.useQuery({
queryKey: [this.key, query],
queryFn: () => this.http.get<Paged<...>>(`${this.endpoint}?${query.buildQueryString()}`)
});
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi @luii , thanks for you help. The Problem
My IntentionI think the issue needs to be solved at "package-level". |
Beta Was this translation helpful? Give feedback.
-
✅ Solution found
|
Beta Was this translation helpful? Give feedback.
-
Hi, it's me again. The guy having problems with After installing I took a look that the packag.json from Maybe adding this as dependency would solve the problem. 🤔 |
Beta Was this translation helpful? Give feedback.
-
I installed |
Beta Was this translation helpful? Give feedback.
-
👷🏻 Workaround
|
Beta Was this translation helpful? Give feedback.
👷🏻 Workaround
If anyone experiences the
A type annotation is necessary.
-Error, I would go for:Make sure having
tslib
is installed.@tanstack/query-core
added to dependencies of the project.