This error occurs when the stylesheet that the css setting of the project
selects cannot be found. Stillwind reads the theme, utilities, and variants from
that stylesheet, so it cannot compile without it.
Reported
import { defineConfig } from "stillwind/config";
export default defineConfig({
projects: [
{
css: "./src/stilwind.css",
files: ["src/**/*.tsx"],
},
],
});SW02002: the root CSS source cannot be unresolved
Fixed
import { defineConfig } from "stillwind/config";
export default defineConfig({
projects: [
{
css: "./src/stillwind.css",
files: ["src/**/*.tsx"],
},
],
});How to fix
- Check the path in
css. It is relative to therootof the project, or to the configuration file whenrootis not set. - If you write your own integration, answer the request for the root stylesheet with its source text. Only imported stylesheets may be unresolved.