Skip to content

separate type contexts for nitro, nuxt & modules/nuxt.config #22572

@TheAlexLichter

Description

@TheAlexLichter

Environment


  • Operating System: Darwin
  • Node Version: v18.16.1
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: pnpm@8.5.0
  • Builder: vite
  • User Config: devtools, nitro
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-22572?file=nuxt.config.ts

  1. Open the repo and nuxt.config.ts
  2. See no TS errors
  3. See errors when running as defineEventHandler is not defined but gives false type safety.

Describe the bug

In the nuxt.config.ts, imports like defineEventHandler or $fetch are wrongly "available" as auto-imports on the type-level, while using them without importing them would throw.

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions