vue-query: `queryOptions()`'s real return type is unexported; the public name with the same identifier points at a different, legacy type
Mantenedores costumam responder em até 1 dia
@okxint já está trabalhando nisso.
Desde 9/11/2026.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- typescript
Direção de pesquisa
Comece pelas declarações publicadas em build/modern/_tsup-dts-rollup.d.ts e pelas exportações em build/modern/index.d.ts; depois, leia a implementação de queryOptions e o README.md do repositório de reprodução. Execute as reproduções listadas com tsdown e tsc; considera-se concluído quando as declarações forem emitidas sem TS2527/TS2883 e a composição downstream de select preservar os tipos corretos de query options e DataTag.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
Since the 5.98.0 rewrite ("fix(vue-query): fix type of queryOptions to allow plain properties or getters"), queryOptions() is typed against a new QueryOptions-based shape. In the published rollup declaration file (build/modern/_tsup-dts-rollup.d.ts) this shape exists as UndefinedInitialQueryOptions_alias_1 / DefinedInitialQueryOptions_alias_1 — but:
_alias_1is not exported from the package root (build/modern/index.d.ts).- The public names
UndefinedInitialQueryOptions/DefinedInitialQueryOptionsare re-exported from the root, but they still point at the old,UseQueryOptions-based,MaybeRef<...>-union type. Two genuinely different types share one exported name; only the wrong one is reachable. - Supporting types referenced by the new signature are unexported too: vue-query's
ShallowOption, its localMaybeRefOrGetteralias, and query-core'sQueryBehavior,RetryValue,RetryDelayValue, plus a non-exportedunique symbol(dataTagErrorSymbol).
Any library that exports a function returning queryOptions(...) with an inferred return type — the exact pattern @kubb/plugin-vue-query generates for every endpoint — hits one of two consequences when its declarations are emitted:
- Hard declaration-emit errors (
TS2527/TS2883) — reproduced here with bothtsdown/rolldown-plugin-dtsand plaintsc. - Silently WRONG declarations — the natural fix for (1) is to annotate the return type with the public
UndefinedInitialQueryOptions. That compiles with zero errors, but it is the wrong type: a consumer spreading the factory's result into anotherqueryOptions()call to addselectfails to type-check, and theDataTagonqueryKeyis lost.
Both are reproduced below, from the same root cause: the name collision.
Your minimal, reproducible example
https://github.com/DesselBane/repro-vue-query-query-options
Steps to reproduce
See repo README.md
Expected behavior
No TS2527 error and/or correct type exported so that downstream select works
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
| Package | Version |
|---|---|
@tanstack/vue-query |
5.101.2 (also confirmed broken at 5.98.0; 5.97.0 is clean — see Regression window) |
@tanstack/query-core |
5.101.2 (transitive) |
typescript |
6.0.3 |
vue |
3.5.31 |
tsdown |
0.21.4 ([email protected], [email protected]) |
| Node | v24.0.0 |
| OS | Windows 11 |
Tanstack Query adapter
vue-query
TanStack Query version
5.98.0 (and 5.101.2)
TypeScript version
6.0.3
Additional context
Diagnosis and reproduction were created with the help of CLAUDE. I checked the repo and as far as I can tell this is all correct.
- Linguagem predominante
- TypeScript
- Estrelas
- 50.6k
- Forks
- 4.2k
- Merge médio
- 9h 50min
- PRs com merge (30d)
- 310
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/query
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
TanStack/query#12466 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Talvez livre de novo @LeonxLJX assumiu há 77 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
TanStack/query#11358 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
select that throws for placeholderData brings back the selection of data removed by resetQueriesTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 56/100
Mantenedores costumam responder em até 1 dia
-
Render loop since v5.105.2 when placeholderData, or its select result, is not referentially stableAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 54/100
Mantenedores costumam responder em até 1 dia
-
useQueries: stable combine returns a stale result when a query updates before setQueries runsTalvez já em andamento @sakaintp assumiu há 1 dia. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
TanStack/query#12626 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/query
Issues semelhantes
-
inference/go type/feature
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 72/100
anomalyco/opencode#65148 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
truapi-release
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
paritytech/product-sdk#529 ·
Mantenedores costumam responder em até 1 dia
-
Add: Mansudae TVAbertaapproved check:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 1 dia
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
devlikeapro/waha#2369 ·
Mantenedores costumam responder em até 5 dias