question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS(2322) with NuxtWelcome missing lang="ts"

See original GitHub issue

Environment

  • 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

Nuxt 2322 Issue

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
johnsoncodehkcommented, Jun 8, 2022

@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 in lang="ts" component. app.vue do not have script block so it’s lang="ts" by default.

Nice to have a issue in https://github.com/johnsoncodehk/volar/issues. 😃

2reactions
danielroecommented, Jun 12, 2022

Now resolved in volar! ❤️

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found