Export MutationResult type
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Bắt đầu với các kiểu được export của Vue Query cho useMutation và khai báo MutationResult; issue không nêu đường dẫn tệp trong repository, vì vậy hãy tìm chúng từ các điểm đầu vào công khai của Vue adapter. Tái hiện lỗi được báo cáo bằng sandbox được liên kết và pnpm exec vue-tsc --build --noEmit --force. Hoàn thành khi kiểu có thể được gọi tên công khai và lệnh chạy xong mà không có lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 50.4k
- Fork
- 4.2k
- Merge trung bình
- 7 giờ 10 phút
- Pull request đã merge (30 ngày)
- 385
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Có thể làm lại được @LeonxLJX đã nhận 36 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11358 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Có thể đã có người làm @MaNaN1803 đã nhận 79 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11106 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
restoreQueries and persisterGc throw on malformed persisted entriesCó thể đã có người làm @VGontier-cmd đã nhận 4 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater valueCó thể đã có người làm @iosayin đã nhận 5 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/query
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
supadata-ai/mcp#27 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
capricorn86/happy-dom#2485 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
优化导入 OCR 模型选择文件的按钮样式Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
siyuan-note/siyuan#20430 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Albert-Weasker/niubigeo#194 ·
Maintainer thường phản hồi trong vòng 1 ngày