Skip to content

Nuxt 4.0.0.-alpha.1: compatibilityVersion reverting to 3 with Nuxt UI (and probably other modules) #32311

@Ragura

Description

@Ragura

Environment

  • Operating System: Darwin
  • Node Version: v22.15.0
  • Nuxt Version: 4.0.0-alpha.1
  • CLI Version: 3.25.1
  • Nitro Version: 2.11.12
  • Package Manager: pnpm@10.11.0
  • Builder: -
  • User Config: compatibilityDate, modules, future, css, devtools
  • Runtime Modules: @nuxt/ui@3.1.3
  • Build Modules:

Reproduction

https://github.com/Ragura/nuxt4-alias-issue

Describe the bug

With Nuxt 4 alpha (4.0.0-alpha.1) it's no longer needed to include compatibilityVersion: 4 in the config. However, when leaving it out some modules seem to enable compatibilityVersion: 3 instead, breaking aliases due to the changes in folder structure.
An example of this is Nuxt UI. In a minimal project with only Nuxt 4 alpha and Nuxt UI, it will already show the problem.

Update: since this was posted other people have run into this problem, with modules other than Nuxt UI. I can confirm Drizzle also trips up over this when running db:generate. It will fail to resolve the ~~ or ~ alias to import modules from the shared folder.

Additional context

No response

Logs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions