@@ -233,7 +233,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
233233
234234 const body = Buffer . from ( await response . arrayBuffer ( ) ) ;
235235
236- save ( 'pages' , response , body , decoded , encoded , referrer , 'linked' ) ;
236+ await save ( 'pages' , response , body , decoded , encoded , referrer , 'linked' ) ;
237237
238238 for ( const [ dependency_path , result ] of dependencies ) {
239239 // this seems circuitous, but using new URL allows us to not care
@@ -257,7 +257,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
257257
258258 const body = result . body ?? new Uint8Array ( await result . response . arrayBuffer ( ) ) ;
259259
260- save (
260+ await save (
261261 'dependencies' ,
262262 result . response ,
263263 body ,
@@ -305,7 +305,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
305305 /** @type {Set<string> } */ ( expected_hashlinks . get ( key ) ) . add ( decoded ) ;
306306 }
307307
308- enqueue ( decoded , decode_uri ( pathname ) , pathname ) ;
308+ await enqueue ( decoded , decode_uri ( pathname ) , pathname ) ;
309309 }
310310 }
311311 }
@@ -319,7 +319,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
319319 * @param {string | null } referrer
320320 * @param {'linked' | 'fetched' } referenceType
321321 */
322- function save ( category , response , body , decoded , encoded , referrer , referenceType ) {
322+ async function save ( category , response , body , decoded , encoded , referrer , referenceType ) {
323323 const response_type = Math . floor ( response . status / 100 ) ;
324324 const headers = Object . fromEntries ( response . headers ) ;
325325
@@ -341,7 +341,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
341341 if ( location ) {
342342 const resolved = resolve ( encoded , location ) ;
343343 if ( is_root_relative ( resolved ) ) {
344- enqueue ( decoded , decode_uri ( resolved ) , resolved ) ;
344+ await enqueue ( decoded , decode_uri ( resolved ) , resolved ) ;
345345 }
346346
347347 if ( ! headers [ 'x-sveltekit-normalize' ] ) {
@@ -459,17 +459,17 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) {
459459
460460 if ( processed_id . includes ( '[' ) ) continue ;
461461 const path = `/${ get_route_segments ( processed_id ) . join ( '/' ) } ` ;
462- enqueue ( null , config . paths . base + path ) ;
462+ await enqueue ( null , config . paths . base + path ) ;
463463 }
464464 }
465465 } else {
466- enqueue ( null , config . paths . base + entry ) ;
466+ await enqueue ( null , config . paths . base + entry ) ;
467467 }
468468 }
469469
470470 for ( const { id, entries } of route_level_entries ) {
471471 for ( const entry of entries ) {
472- enqueue ( null , config . paths . base + entry , undefined , id ) ;
472+ await enqueue ( null , config . paths . base + entry , undefined , id ) ;
473473 }
474474 }
475475
0 commit comments