TS(2322) with NuxtWelcome missing lang="ts"
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
npm@8.5.5
- Builder:
vite
- User Config:
typescript
,ssr
- Runtime Modules:
-
- Build Modules:
-
Version: 1.67.2 (user setup) Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.22000
Volar: 0.35.2
Reproduction
https://github.com/smartmelonsystems/nuxt3-ssg-example
Describe the bug
VSCode problem window shows a TS 2322 issue with NuxtWelcome component. It appears to not recognise the component default values. I’m not sure if this is Nuxt or Volar or VSCode I created my own version of NuxtWelcome (MyNuxtWelcome) I get the same TS2322 issue. However, if I add lang=“ts” in the <script setup> of MyNuxtWelcome component. The issue is resolved.
Am I missing something in my environment or should lang=“ts” be added to Nuxt 3 NuxtWelcome?
Additional context
Logs
[{
"resource": "/c:/YouTubeRepos/nuxt3-ssg-example/nuxt-app/app.vue",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "2322",
"severity": 8,
"message": "Type '{}' is not assignable to type 'IntrinsicAttributes & Partial<{}> & Omit<Readonly<ExtractPropTypes<{}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never> & Readonly<...>'.\n Type '{}' is missing the following properties from type 'Readonly<ExtractPropTypes<{ appName: { type: StringConstructor; default: string; }; version: { type: StringConstructor; default: string; }; title: { type: StringConstructor; default: string; }; readDocs: { ...; }; followTwitter: { ...; }; starGitHub: { ...; }; }>>': title, appName, version, readDocs, and 2 more.",
"source": "ts",
"startLineNumber": 3,
"startColumn": 6,
"endLineNumber": 3,
"endColumn": 17
}]
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Missing preload-helper export in vite package when building ...
Same Problem for me - in my case i had dependencies to vite 3.x. For the moment set Vite version to 2.9.14 fixed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danielroe Thanks for the notification, this is Volar an issue, defineComponent is not working for
lang="js"
so Volar bypass defineComponent to define$props
to provide intellisense, but the type is inaccurate.This problem is on occur when
lang="js"
component usage inlang="ts"
component.app.vue
do not have script block so it’slang="ts"
by default.Nice to have a issue in https://github.com/johnsoncodehk/volar/issues. 😃
Now resolved in volar! ❤️