TypeScript cannot resolve @nuxt/ui types and component slots in Nuxt workspace monorepo

Aperta
#7,389 1 commento 3 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript, vite
Ambito
frontend, tooling

Direzione di ricerca

The report is a TypeScript resolution failure for @nuxt/ui in a monorepo where a Nuxt app extends a shared package that depends on it; the linked reproduction repository is the starting point. Clone it, install dependencies, and run the type check to reproduce the 'Cannot find module' error. Then trace how the extended package's @nuxt/ui types are resolved. Done means the type check passes and the components and slots are typed in the consuming app.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage
Environment

Nuxt project info:

Operating system Linux 6.18.54.1-microsoft-standard-WSL2
CPU 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 cores)
Node.js version v24.21.0
nuxt/cli version 3.37.0
Package manager [email protected]
Nuxt version 4.4.8
Nitro version 2.13.6
Builder [email protected]
Config -
Modules -
Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

v4.12.0

Reproduction

https://github.com/fkwww27/nuxt-bug-reproduction

Description

There is a TypeScript error: Cannot find module '@nuxt/ui' or its corresponding type declarations. when @nuxt/ui is installed in a shared package that is extended by a Nuxt application.

The issue occurs in a monorepo setup where the Nuxt application extends a package that has @nuxt/ui installed as a dependency.

This setup worked correctly in previous versions of Nuxt UI, but the TypeScript error started occurring after upgrading to a newer version.

Additional context

No response

Logs

Lingua principale
TypeScript
Stelle
7.1k
Fork
1.2k
Merge medio
1g 2h
PR unite (30g)
147

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nuxt/ui

Tutte le issue di nuxt/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.