-
Notifications
You must be signed in to change notification settings - Fork 712
type errors on slots with vue-tsc 2.2.4 #3405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like it is because of the update of vue-tsc from 2.2.0 to 2.2.4 |
Indeed, we still have to look into this. I'd recommend setting the resolution to |
I wasn't able to fix this error by downgrading. It reduced error count from
I think it may be related to 6120a15, but when I tried using
Which wasn't even touched between this commit and v3.0.0-beta.3. I even tried it patching with pnpm, but I still couldn't make it work. |
I've fixed the I also encountered some issues with |
Yeah, thanks! It fixes this issue for me, but due to vuejs/language-tools#5183 I can't use Update: It seems to be related to vuejs/language-tools#5206 and vuejs/language-tools#5247 but using |
Yeah I also tried |
@benjamincanac are people from |
v3 was released and is sill an issue. |
Downgrading to |
Yup, fixed it for me as well |
also the downgrading work for me 🤷♂️ |
Yup confirm it's working as well. |
I tried different versions: but I still have 50 errors in @nuxt/[email protected] :( Tips for collapsed sections
(edited by moderator for clarity) |
Make sure you set it to 2.2.2 in resolutions field too |
@benjamincanac The issue seems to be resolved in The problem seems to be typing <template v-for="(_, name) in proxySlots" #[name]="slotData: any">
<slot :name="name" v-bind="slotData" />
</template>
|
Unfortunately, even with resolutions, I still have 50 errors. My config:
|
I've also tested different version of vue-tsc: |
We are on vue-tsc 3 alpha, and only have this one error left. |
3.0.0-alpha.2 does indeed fix vuejs/language-tools#5206 for me. Edit: nevermind the "fix" is simply due to broken error mapping once again: vuejs/language-tools#5206 (comment) |
I'm going to take a look at ATM only two aspects of that PR needs to be addressed for it to be reviewed:
|
Hey, I updated the packages to the latest versions today. ERROR(vue-tsc) Argument of type '{ item: T; index: number; open: boolean; }' is not assignable to parameter of type 'NonNullable<({ leading: SlotProps; default: SlotProps; trailing: SlotProps; content: SlotProps; body: SlotProps; } & DynamicSlots<...>)["leading"] & SlotProps<...>> extends (props: infer P) => any ? P : {}'. . [vue-tsc] Found 44 errors. Watching for file changes.
|
@benjamincanac I think this may have been part of the issue, but not entirely. I first tried downgrading to I also tried downgrading to Nuxt 3.16.1 with Nitro 2.11.8 nuxi 6:06:50 AM
6:06:51 AM
➜ Local: http://localhost:3000/
➜ Network: use --host to expose
➜ DevTools: press Shift + Option + D in the browser (v2.3.2) 6:06:51 AM
ℹ Nuxt Icon server bundle mode is set to local 6:06:53 AM
✔ Vite client built in 24ms 6:06:53 AM
✔ Vite server built in 133ms 6:06:53 AM
ERROR [uncaughtException] getLanguagePlugins is not a function 6:06:53 AM
at Object.apply (node_modules/.pnpm/@volar+typescript@2.1.6/node_modules/@volar/typescript/lib/node/proxyCreateProgram.js:12:67)
at getBuilderCreationParameters (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/typescript.js:130522:18)
at createSemanticDiagnosticsBuilderProgram (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/typescript.js:131177:5)
at createNewProgram (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/typescript.js:133257:22)
at synchronizeProgram (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/typescript.js:133221:7)
at Object.createWatchProgram (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/typescript.js:133129:3)
at Object.configureServer (node_modules/.pnpm/vite-plugin-checker@0.9.1_eslint@9.23.0_jiti@2.4.2__optionator@0.9.4_typescript@5.8.2_v_4f24b610efffeedf20cfeb4fd229bbc6/node_modules/vite-plugin-checker/src/checkers/vueTsc/main.ts:143:13) However, the one error that still remains is the following, and does not seem to be related to this. Nuxt 3.16.1 with Nitro 2.11.8 nuxi 6:08:17 AM
6:08:17 AM
➜ Local: http://localhost:3000/
➜ Network: use --host to expose
➜ DevTools: press Shift + Option + D in the browser (v2.3.2) 6:08:17 AM
ℹ Nuxt Icon server bundle mode is set to local 6:08:18 AM
✔ Vite client built in 23ms 6:08:18 AM
✔ Vite server built in 138ms 6:08:18 AM
✔ Nuxt Nitro server built in 389ms nitro 6:08:19 AM
ℹ Vite client warmed up in 1ms 6:08:19 AM
✘ [ERROR] Could not resolve "#build/app.config"
node_modules/.pnpm/@nuxt+ui@3.0.2_@babel+parser@7.27.0_db0@0.3.1_embla-carousel@8.5.2_ioredis@5.6.0_magica_31f89cd058d8b77b3442b765da8f3a40/node_modules/@nuxt/ui/dist/runtime/vue/stubs.js:3:22:
3 │ import appConfig from "#build/app.config";
╵ ~~~~~~~~~~~~~~~~~~~
The package import "#build/app.config" is not defined in this "imports" map:
node_modules/.pnpm/@nuxt+ui@3.0.2_@babel+parser@7.27.0_db0@0.3.1_embla-carousel@8.5.2_ioredis@5.6.0_magica_31f89cd058d8b77b3442b765da8f3a40/node_modules/@nuxt/ui/package.json:45:13:
45 │ "imports": {
╵ ^
You can mark the path "#build/app.config" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.
ERROR error while updating dependencies: 6:08:19 AM
Error: Build failed with 1 error:
node_modules/.pnpm/@nuxt+ui@3.0.2_@babel+parser@7.27.0_db0@0.3.1_embla-carousel@8.5.2_ioredis@5.6.0_magica_31f89cd058d8b77b3442b765da8f3a40/node_modules/@nuxt/ui/dist/runtime/vue/stubs.js:3:22: ERROR: Could not resolve "#build/app.config"
at failureErrorWithLog (/Users/main/Documents/nuxt_project/node_modules/.pnpm/esbuild@0.25.2/node_modules/esbuild/lib/main.js:1477:15)
at /Users/main/Documents/nuxt_project/node_modules/.pnpm/esbuild@0.25.2/node_modules/esbuild/lib/main.js:946:25
at /Users/main/Documents/nuxt_project/node_modules/.pnpm/esbuild@0.25.2/node_modules/esbuild/lib/main.js:1355:9
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
ℹ 6:08:22 AM
[vue-tsc] Found 0 errors. Watching for file changes. |
@SoCuul You can use |
@benjamincanac just FYI - with tsc 3.0.0-alpha.2 and newest commit i dont get any errors anymore |
I can also confirm that! I managed to get this PR working Gwardia-Czapli/StoryPointsCasino#18 |
@simonmaass How did you install vue-tsc version 3.0.0-alpha.2 with the newest commit?
|
Vue TSC and newest commit of nuxt ui |
|
my package.json "dependencies": {
"@nuxt/image": "^1.10.0",
"@nuxt/scripts": "^0.11.5",
"@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@4d138ad",
"@nuxtjs/i18n": "9.4.0",
"@nuxtjs/seo": "^3.0.2",
"@pinia/nuxt": "^0.10.1",
"@tsndr/cloudflare-worker-jwt": "^3.1.4",
"@types/js-cookie": "^3.0.6",
"@types/lodash.isequal": "^4.5.8",
"@unhead/shared": "^2.0.3",
"@unhead/ssr": "^2.0.3",
"@vueuse/core": "^13.0.0",
"@vueuse/nuxt": "13.0.0",
"camelcase-keys": "^9.1.3",
"dotenv": "^16.4.7",
"embla-carousel-auto-height": "^8.5.2",
"embla-carousel-auto-scroll": "^8.5.2",
"embla-carousel-autoplay": "^8.5.2",
"embla-carousel-class-names": "^8.5.2",
"embla-carousel-fade": "^8.5.2",
"embla-carousel-vue": "^8.5.2",
"embla-carousel-wheel-gestures": "^8.0.1",
"graphql": "^16.10.0",
"graphql-request": "^7.1.2",
"html-entities": "^2.6.0",
"jose": "^6.0.10",
"lodash.isequal": "^4.5.0",
"maska": "^3.1.1",
"nuxt": "^3.16.2",
"oauth-1.0a": "2.2.6",
"ohash": "^2.0.11",
"pinia": "^3.0.1",
"reka-ui": "^2.2.0",
"sharp": "^0.33.5",
"tailwind-variants": "^1.0.0",
"vue": "latest",
"vue-router": "latest",
"zod": "^3.24.2"
},
"devDependencies": {
"@antfu/eslint-config": "^4.11.0",
"@commitlint/cli": "19.8.0",
"@commitlint/config-conventional": "19.8.0",
"@nuxt/test-utils": "^3.17.2",
"@vue/test-utils": "^2.4.6",
"eslint": "9.23.0",
"happy-dom": "^17.4.4",
"husky": "^9.1.7",
"playwright-core": "^1.51.1",
"ts-node": "^10.9.2",
"typescript": "^5.8.2",
"vite-plugin-graphql-loader": "^4.0.4",
"vitest": "^3.1.1",
"vue-tsc": "3.0.0-alpha.2"
},
"resolutions": {
"vue-tsc": "3.0.0-alpha.2"
} and I still have 44 errors: LOG
(edited by moderator for clarity) |
I might be wrong but as far as I understand the But keep in mind that I'm also working on the windows CI which introduces a new module-builder that also changes how types are generated and executed, this could help as well. PS: |
I confirm that alpha.2 fails silently. |
Sorry for not using collapsed sections. I’m running the following commands:
And I still get: |
For me, the newest vue-tsc version that worked was v2.0.24. |
Do we have any new information about this bug? Interestingly - if I restart the TS server already after building the application everything seems to work correctly, but if the nuxt server requires a restart (for example, some changes in configuration) the errors reappear which is totally strange to me because either it should work or not ;p |
@Gobler i noticed the same behavior with the restart... very weird |
I forgot to give an update here, my bad 🙄 This issue is split on two sides, one here and one upstream on vue-tsc. The later one has been already fixed with vuejs/language-tools#5247, althout it is only available via On Nuxt UI side of things this has been fixed via #3857 that will be available next release along with many other changes and fixes. You might be questioning: "why this hasn't been marked as resolved then?" I'm glad you asked 😬 Atm all the vue-tsc versions between Small side-note for whoever wants to contribute to Nuxt UI: We are still internally on Credits go to @KazariEX who helped me immensively debug and work on this for a few hours |
@sandros94 I’m successfully using the latest snapshots of
This is 1:1 example copied from docs. Not sure if it's related to the typechecking issue in the docs that you mentioned earlier, but just wanted to report it in case it's still relevant. |
@Norbiros i can confirm the error on the onSubmit function - i have the same problem! |
Yes we noticed it too, thanks. |
I installed ui-pro but it display 117 errors :( My TS versions are "typescript": "5.6.3",
"vue-tsc": "2.2.0" Someone knows how to solve it? Display 117 errors ↓Errors Files
3 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/Banner.vue:11
6 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/BlogPost.vue:12
13 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/content/ContentNavigation.vue:13
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/content/ContentSurround.vue:79
6 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/content/ContentToc.vue:12
1 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/DashboardNavbar.vue:84
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/DashboardPanel.vue:45
4 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/DashboardSidebar.vue:152
5 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/FooterColumns.vue:66
1 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/Header.vue:151
4 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/Page.vue:9
6 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageAnchors.vue:58
7 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageCard.vue:11
3 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageCTA.vue:67
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageFeature.vue:62
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageHeader.vue:47
4 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageHero.vue:65
5 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageLinks.vue:60
1 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageList.vue:36
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageLogos.vue:70
6 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageMarquee.vue:10
7 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PageSection.vue:12
4 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PricingPlan.vue:11
3 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/PricingPlans.vue:11
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/prose/Callout.vue:11
3 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/prose/Card.vue:11
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/prose/CodeCollapse.vue:53
4 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/prose/CodePreview.vue:29
2 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/prose/CodeTree.vue:144
5 ../../node_modules/@nuxt/ui-pro/dist/runtime/components/User.vue:63 |
Error free with latest vue-tsc (v2.2.10 ) |
Using |
It seems |
This never ends 😅 @yulafezmesi Would you mind trying with latest package? |
yeap, works well with this version, ty :) however, within upcoming release, having some issues autoimport composables |
Don't bother, this is another issue with |
oh great. thanks!
|
Environment
Is this bug related to Nuxt or Vue?
Nuxt
Version
v3.0.0-alpha.13
Reproduction
not required
Description
run "npx nuxi typecheck"
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: