File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
packages/tailwindcss-language-server/src/util/v4 Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,22 @@ export async function loadDesignSystem(
129
129
} ) ,
130
130
131
131
loadStylesheet : async ( id : string , base : string ) => {
132
- let resolved = resolveCssFrom ( base , id )
133
-
134
- return {
135
- base : path . dirname ( resolved ) ,
136
- content : await fs . readFile ( resolved , 'utf-8' ) ,
132
+ // Skip over missing stylesheets (and log an error) so we can do our best
133
+ // to compile the design system even when the build might be incomplete.
134
+ // TODO: Figure out if we can recover from parsing errors in stylesheets
135
+ // we'd want to surface diagnostics when we discover imports that cause
136
+ // parsing errors or other logic errors.
137
+
138
+ try {
139
+ let resolved = resolveCssFrom ( base , id )
140
+
141
+ return {
142
+ base : path . dirname ( resolved ) ,
143
+ content : await fs . readFile ( resolved , 'utf-8' ) ,
144
+ }
145
+ } catch ( err ) {
146
+ console . error ( `Unable to load stylesheet: ${ id } ` , err )
147
+ return { base, content : '' }
137
148
}
138
149
} ,
139
150
You can’t perform that action at this time.
0 commit comments