Closed AlexXanderGrib closed 10 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
trpc-nuxt | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 6, 2024 8:49am |
Found cause of typescript behavior. It is broken by moduleResolution: "Bundler"
set in tsconfig.json by nuxt. But it still better be fixed on your side. Quick fix for everybody with same issue:
// nuxt.config.ts
export default defineNuxtConfig({
typescript: {
strict: true,
tsConfig: {
compilerOptions: {
moduleResolution: "Node"
}
}
},
});
Why?
Usage of internal types was a massive headache for me for last 4 hours. In some of my project typescript decides to respect "exports" field in package.json, and internal types become
any
. So data field inuseQuery()
also becameany
and i broke the prod.