Skip to content
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

Type issue while using Nuxt 3, Typsecript and Vue 3 #366

Closed
jesspinklet opened this issue Feb 6, 2024 · 3 comments · Fixed by #421
Closed

Type issue while using Nuxt 3, Typsecript and Vue 3 #366

jesspinklet opened this issue Feb 6, 2024 · 3 comments · Fixed by #421

Comments

@jesspinklet
Copy link

Describe the bug
I'm using Nuxt 3 and Vue 3

image

While I'm importing the components in viruta 0.23.3 it throws error at just in vs-code and not in production.

@inokawa
Copy link
Owner

inokawa commented Feb 6, 2024

Could you show me your tsconfig?
Set moduleResolution: "bundler" to your config may solve the problem for now.

@jesspinklet
Copy link
Author

Could you show me your tsconfig? Set moduleResolution: "bundler" to your config may solve the problem for now.

{
	// https://nuxt.com/docs/guide/concepts/typescript
	"extends": "./.nuxt/tsconfig.json",
	"compilerOptions": {
		"types": [
		  "@nuxtjs/i18n",
		]
	  }
}

Which can be customized by nuxt.config.ts.
And inside nuxt config I have this option for bundler resolution.

  future: {
    typescriptBundlerResolution: false
  },

for further information to the latest Nuxt blog explains the Bundler module resolution

@inokawa
Copy link
Owner

inokawa commented Feb 8, 2024

Thanks. typescriptBundlerResolution: true may solve the problem because Vue entry point of virtua is using exports of package.json, which can't be handled in TypeScript without moduleResolution: bundler or moduleResolution: nodenext.

We may implement fallback for legacy TypeScript if it's important for Vue ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants