nuxt / module-builder

Complete solution to build and ship Nuxt modules.
MIT License
224 stars 24 forks source link

Playground Typecheck error #236

Closed dvdmlln closed 5 months ago

dvdmlln commented 6 months ago

Hi,

I ran into some issues when using typecheck on my module. Previously, my tsconfig.json looked like this

{
  "extends": "./playground/.nuxt/tsconfig.json"
}

and everything worked using nuxi typecheck.

After I changed the extends path to ./.nuxt/tsconfig.json, just like when you create a new module with npx nuxi init -t module, the typechecks won't work anymore.

See this reproduction. npm run typecheck1 doesn't work because the auto-imports from my module are missing and the @ alias in the playground can't be resolved. npm run typecheck2 only fails because of the playground @ alias.

Best regards David

danielroe commented 5 months ago
  1. Yes, you need to run dev:prepare before checking types - using vue-tsc --noEmit is correct for a
  2. The typecheck in root directory will correctly check your module but not the playground, so you should exclude it and run a second typecheck within your playground directory

Updated module template - thanks for the ping: https://github.com/nuxt/starter/commit/2dba71f74f2e9be05d06784dd5462e44b2299fbc