File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ if (!import.meta.url.includes('node_modules')) {
7
7
// only available as dev dependency
8
8
await import ( 'source-map-support' ) . then ( ( r ) => r . default . install ( ) )
9
9
} catch { }
10
+
11
+ process . on ( 'unhandledRejection' , ( err ) => {
12
+ throw new Error ( 'UNHANDLED PROMISE REJECTION' , { cause : err } )
13
+ } )
10
14
}
11
15
12
16
global . __vite_start_time = performance . now ( )
Original file line number Diff line number Diff line change @@ -307,7 +307,9 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
307
307
308
308
// warm up cache for resolved postcss config
309
309
if ( config . css ?. transformer !== 'lightningcss' ) {
310
- resolvePostcssConfig ( config )
310
+ resolvePostcssConfig ( config ) . catch ( ( ) => {
311
+ /* will be handled later */
312
+ } )
311
313
}
312
314
313
315
return {
@@ -1696,9 +1698,14 @@ async function resolvePostcssConfig(
1696
1698
return null
1697
1699
} )
1698
1700
// replace cached promise to result object when finished
1699
- result . then ( ( resolved ) => {
1700
- postcssConfigCache . set ( config , resolved )
1701
- } )
1701
+ result . then (
1702
+ ( resolved ) => {
1703
+ postcssConfigCache . set ( config , resolved )
1704
+ } ,
1705
+ ( ) => {
1706
+ /* keep as rejected promise, will be handled later */
1707
+ } ,
1708
+ )
1702
1709
}
1703
1710
1704
1711
postcssConfigCache . set ( config , result )
You can’t perform that action at this time.
0 commit comments