Skip to content

[v4] Something has broken since alpha.15, causing imports in CSS files and vite URL imports to not work #14558

@candidia

Description

@candidia

What version of Tailwind CSS are you using?

v4.0.0-alpha.25

What build tool (or framework if it abstracts the build tool) are you using?

vite 5.4.8

What version of Node.js are you using?

bun 1.1.27

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

Unfortunately Stackblitz doesn't support creating a repro since it can't run the tailwind wasm module used in the @tailwindcss/vite plugin.

Describe your issue

With v4.0.0-alpha.15, I can have a css file that does:

@import "tailwindcss";
@import "common/base.css";

and use that stylesheet as a vite URL import:

import stylesUrl from "./root.css?url";

However, when I just upgrade to v4.0.0-alpha.25, I get

  1. Uncaught SyntaxError: The requested module '/app/root.css?url' does not provide an export named 'default' because the vite URL imports have broken.

If I just import normally without the URL suffix (import "./root.css";),

  1. Now not all the styles from common/base.css which is imported in ./root.css apply, and trying to do something basic like reassign a CSS variable in ./root.css no longer works:
@theme {
	--color-bg: orange;
}

That works back on v4.0.0-alpha.15.

Please let me know if I can provide more info, or if instead of Stackblitz, there is another provider that does support wasm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions