diff --git a/packages/tailwindcss-language-server/src/css/resolve-css-imports.ts b/packages/tailwindcss-language-server/src/css/resolve-css-imports.ts index 788b5eea..6699cfb5 100644 --- a/packages/tailwindcss-language-server/src/css/resolve-css-imports.ts +++ b/packages/tailwindcss-language-server/src/css/resolve-css-imports.ts @@ -11,7 +11,22 @@ const resolver = createResolver({ const resolveImports = postcss([ postcssImport({ - resolve: (id, base) => resolveCssFrom(base, id), + resolve(id, base) { + try { + return resolveCssFrom(base, id) + } catch (e) { + // TODO: Need to test this on windows + return `/virtual:missing/${id}` + } + }, + + load(filepath) { + if (filepath.startsWith('/virtual:missing/')) { + return Promise.resolve('') + } + + return fs.readFile(filepath, 'utf-8') + }, }), fixRelativePaths(), ])