File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,7 +201,20 @@ export class BundleOrchestrator extends Transform {
201201 try {
202202 // Produce error if there are bundles without all requirements
203203 if ( this . scriptBundles . size > 0 || this . styleBundles . size > 0 ) {
204- throw new Error ( "Stream completed before all bundles received their dependencies" ) ;
204+ const missingBundles : {
205+ type : BundleType ,
206+ name : string ,
207+ remainingFiles : string [ ] ,
208+ } [ ] = [ ] ;
209+ for ( const bundle of this . scriptBundles ) {
210+ missingBundles . push ( bundle . report ( ) ) ;
211+ }
212+ for ( const bundle of this . styleBundles ) {
213+ missingBundles . push ( bundle . report ( ) ) ;
214+ }
215+ const errMessage = "Stream completed before all bundles received their dependencies" ;
216+ this . logger . error ( errMessage , missingBundles ) ;
217+ throw new Error ( errMessage ) ;
205218 }
206219
207220 // Invoke results callback
@@ -210,7 +223,7 @@ export class BundleOrchestrator extends Transform {
210223 callback ( ) ;
211224 }
212225 catch ( error ) {
213- this . logger . error ( "_flush completed with error" , { error } ) ;
226+ this . logger . error ( "_flush completed with error" , { error : error ?. toString ( ) ?? error } ) ;
214227 callback ( new PluginError ( PluginName , error ) ) ;
215228 }
216229 }
Original file line number Diff line number Diff line change @@ -142,4 +142,16 @@ export class Bundle {
142142 return false ;
143143 }
144144 }
145+
146+ /**
147+ * Returns an object used for reporting bundle status when the stream completes before all required
148+ * files have been received.
149+ */
150+ public report ( ) {
151+ return {
152+ type : this . type ,
153+ name : this . name ,
154+ remainingFiles : this . remainingPaths . slice ( ) ,
155+ } ;
156+ }
145157}
You can’t perform that action at this time.
0 commit comments