Skip to content

PiT 25.1: Tailwind CSS plugin fails to resolve relative @import "theme-editor.css" in styles.css #23560

@manolo

Description

@manolo

Description of the bug

When running expo-flow demo with Vaadin 25.1.0-alpha6 in dev mode, the @tailwindcss/vite:generate:serve plugin fails to resolve a relative @import "theme-editor.css" in styles.css, even though the file exists in the same directory (src/main/resources/META-INF/resources/).

[vite] Internal server error: Can't resolve 'theme-editor.css' in '.../src/main/resources/META-INF/resources'
  Plugin: @tailwindcss/vite:generate:serve
  File: .../src/main/frontend/generated/tailwind.css?inline

This works correctly with Vaadin 25.0.3 (stable). The error prevents the application from loading in the browser.

Expected behavior

The @import "theme-editor.css" in styles.css should be resolved correctly by the Tailwind CSS Vite plugin, as the referenced file exists in the same directory.

Minimal reproducible example

git clone git@github.com:vaadin/expo-flow.git
cd expo-flow
git checkout v25

# Change vaadin.version to 25.1.0-alpha6
perl -pi -e 's|(\s*<vaadin.version>)[^\s]+(<\/vaadin.version>)|${1}25.1.0-alpha6${2}|g' pom.xml

# Change exampledata version for compatibility
perl -0777 -pi -e 's|(\s+)(<dependency>\s*<groupId>)(com.vaadin)(</groupId>\s*<artifactId>)(exampledata)(</artifactId>\s*)(?:(<version>)([^<]+)(</version>))?(\s*)(.*?)?(\s*</dependency>)|${1}${2}com.vaadin${4}exampledata${6}${7}7.0.0-alpha1${9}${10}${11}${12}|msg' pom.xml

./mvnw -ntp -B
# Open http://localhost:8080/ - page shows Vite error overlay

The relevant files:

  • src/main/resources/META-INF/resources/styles.css contains @import "theme-editor.css";
  • src/main/resources/META-INF/resources/theme-editor.css exists (generated by Vaadin Theme Editor)

Versions

  • Vaadin / Flow version: 25.1.0-alpha6
  • Works correctly in: 25.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    🔖 High Priority (P1)

    Status

    ⚒️ In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions