File tree 1 file changed +6
-18
lines changed
packages/vite/src/node/plugins
1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -116,31 +116,19 @@ export function optimizedDepsBuildPlugin(config: ResolvedConfig): Plugin {
116
116
// If all the inputs are dependencies, we aren't going to get any
117
117
const info = optimizedDepInfoFromFile ( depsOptimizer . metadata , file )
118
118
if ( info ) {
119
- try {
120
- // This is an entry point, it may still not be bundled
121
- await info . processing
122
- } catch {
123
- // If the refresh has not happened after timeout, Vite considers
124
- // something unexpected has happened. In this case, Vite
125
- // returns an empty response that will error.
126
- // throwProcessingError(id)
127
- return
128
- }
119
+ await info . processing
129
120
isDebug && debug ( `load ${ colors . cyan ( file ) } ` )
130
121
} else {
131
- // TODO: error
132
- return
122
+ throw new Error (
123
+ `Something unexpected happened while optimizing "${ id } ".` ,
124
+ )
133
125
}
134
126
135
127
// Load the file from the cache instead of waiting for other plugin
136
128
// load hooks to avoid race conditions, once processing is resolved,
137
129
// we are sure that the file has been properly save to disk
138
- try {
139
- return await fs . readFile ( file , 'utf-8' )
140
- } catch ( e ) {
141
- // Outdated non-entry points (CHUNK), loaded after a rerun
142
- return ''
143
- }
130
+
131
+ return await fs . readFile ( file , 'utf-8' )
144
132
} ,
145
133
}
146
134
}
You can’t perform that action at this time.
0 commit comments