Skip to content

Compatibility Issue: Cannot resolve Nuxt UI's #build/ui.css alias #5487

@xlsama

Description

@xlsama

Problem

When using prettier-plugin-tailwindcss with Nuxt UI 4.2.0, Prettier fails with the following error:

Error: Can't resolve '#build/ui.css' in '.../node_modules/@nuxt/ui/dist/runtime'

Environment

  • @nuxt/ui: ^4.2.0
  • prettier-plugin-tailwindcss: ^0.7.1
  • prettier: ^3.6.2
  • nuxt: ^4.2.1

Workaround

Remove tailwindStylesheet from .prettierrc.json. The plugin will still work using its default Tailwind discovery mechanism.

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

4.2.0

Reproduction

  1. Create a CSS file with @import '@nuxt/ui';
  2. Configure .prettierrc.json with tailwindStylesheet pointing to that CSS file
  3. Run prettier --write .
  4. Error occurs

Description

.

Additional context

No response

Logs

[error] app/components/home/Card.vue: Error: Can't resolve '#build/ui.css' in '/Users/xlsama/w/store-health-web/node_modules/.pnpm/@nuxt+ui@4.2.0_@babel+parser@7.28.5_async-validator@4.2.5_change-case@5.4.4_db0@0.3.4_e_66a90f6365abf4cefd0d434e2d3f0e4e/node_modules/@nuxt/ui/dist/runtime'
[error]     at h (file:///Users/xlsama/w/store-health-web/node_modules/.pnpm/prettier-plugin-tailwindcss@0.7.1_@prettier+plugin-oxc@0.0.5_prettier@3.6.2/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:231:4669)
app/components/home/Compliance.vue
[error] app/components/home/Compliance.vue: Error: Can't resolve '#build/ui.css' in '/Users/xlsama/w/store-health-web/node_modules/.pnpm/@nuxt+ui@4.2.0_@babel+parser@7.28.5_async-validator@4.2.5_change-case@5.4.4_db0@0.3.4_e_66a90f6365abf4cefd0d434e2d3f0e4e/node_modules/@nuxt/ui/dist/runtime'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2-mediumNotable issue or useful enhancementv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions