Export MutationResult type
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- api
Línea de trabajo
Empieza por las exportaciones de tipos de Vue Query de useMutation y la declaración de MutationResult; el issue no indica rutas de archivos del repositorio, así que localízalas desde los puntos de entrada públicos del adaptador de Vue. Reproduce el error informado con el sandbox enlazado y pnpm exec vue-tsc --build --noEmit --force. Se considera terminado cuando el tipo se puede nombrar públicamente y el comando finaliza sin errores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I am trying to upgrade @tanstack/vue-query to version 5.104.0, but I am encountering a typescript error in my mutators -- the ones that use the useMutation export.
For example,
// useExampleMutation.ts
import { useMutation } from '@tanstack/vue-query'
export const useExampleMutation = () => {
return useMutation({
mutationFn: async () => 'ok',
})
}
Typescript fails with the following error when reading this module:
TS2883: The inferred type of 'useExampleMutation' cannot be named without a reference to 'MutationResult' from '@tanstack/vue-query/build/modern/useMutation'. This is likely not portable. A type annotation is necessary.
Project conditions under which this error was encountered:
.nvmrc
24
package.json
{
"dependencies": {
"@tanstack/vue-query": "5.104.0",
"vue": "3.5.43"
},
"devDependencies": {
"@tsconfig/node24": "24.0.5",
"@vitejs/plugin-vue": "^6.0.9",
"typescript": "^6.0.3",
"vite": "8.3.1",
"vue-tsc": "^3.3.11"
},
"packageManager": "[email protected]+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
}
tsconfig.json
{
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "bundler",
"strict": true,
"target": "esnext",
"skipLibCheck": true
},
"include": ["src"]
}
tsconfig.node.json
{
"extends": "@tsconfig/node24/tsconfig.json",
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
I have added a link to a sandbox with the example module and relevant configs, as requested.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/hvgzvv
Steps to reproduce
Assuming the project is a minimal reproduction as provided in the sandbox link:
- run
nvm install 24to make sure Node 24 is present - run
nvm useto make sure Node 24 is the active runtime - run
corepack installto make sure thatpnpmis available - run
pnpm install - run
pnpm exec vue-tsc --build --noEmit --forceto produce the typescript error
Expected behavior
Running pnpm exec vue-tsc --build --noEmit --force returns with 0 errors reported.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: not applicable (vue-tsc)
- Version: not applicable (vue-tsc)
Tanstack Query adapter
vue-query
TanStack Query version
v5.104.0
TypeScript version
v6.0.3
Additional context
Originally (sloppily) reported with AI "assistance" in https://github.com/TanStack/query/issues/11769. Apologies for missing the mark on your AI Contribution Policy. I am a real developer, and this is a real problem I really encountered.
- Lenguaje dominante
- TypeScript
- Estrellas
- 50.4k
- Forks
- 4.2k
- Merge medio
- 6 h 55 min
- PR fusionados (30 d)
- 390
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Quizá libre de nuevo @LeonxLJX la tomó hace 35 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TanStack/query#11358 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Posiblemente ocupada @MaNaN1803 la tomó hace 78 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TanStack/query#11106 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
restoreQueries and persisterGc throw on malformed persisted entriesPosiblemente ocupada @VGontier-cmd la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater valuePosiblemente ocupada @iosayin la tomó hace 4 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/query
Issues similares
-
First unknown-user login after boot is one scrypt run slower than a real user's wrong passwordAbiertoarea: backend bug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
snapotter-hq/SnapOtter#2254 ·
Los mantenedores suelen responder en 1 día
-
bug ticket
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cratestack/cratestack#1154 ·
Los mantenedores suelen responder en 1 día
-
server 消息处理器 cmd 分支补显式错误回报——竞态非法命令现走未处理拒绝Posiblemente ocupada @openaddr la tomó hoy. Abiertoready-for-agent refactor wayfinder:task
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openaddr/dafung-web#428 ·
Los mantenedores suelen responder en 1 día
-
Flaky: mongodb-memory-server 'Port already in use' when another process starts a mongod concurrentlyAbiertoarea:testing bug effort:S priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
lens:agent lens:process process
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
thebristolsound/birdbrain#1772 ·
Los mantenedores suelen responder en 1 día