@@ -1153,16 +1153,16 @@ export async function build({
11531153 debug ( `node-file-trace result for pages: ${ fileList } ` ) ;
11541154
11551155 const lstatSema = new Sema ( 25 , {
1156- capacity : fileList . length + apiFileList . length ,
1156+ capacity : fileList . size + apiFileList . size ,
11571157 } ) ;
11581158 const lstatResults : { [ key : string ] : ReturnType < typeof lstat > } = { } ;
11591159
11601160 const collectTracedFiles = (
11611161 reasons : NodeFileTraceReasons ,
11621162 files : { [ filePath : string ] : FileFsRef }
11631163 ) => async ( file : string ) => {
1164- const reason = reasons [ file ] ;
1165- if ( reason && reason . type === 'initial' ) {
1164+ const reason = reasons . get ( file ) ;
1165+ if ( reason && reason . type . indexOf ( 'initial' ) !== - 1 ) {
11661166 // Initial files are manually added to the lambda later
11671167 return ;
11681168 }
@@ -1183,10 +1183,10 @@ export async function build({
11831183 } ;
11841184
11851185 await Promise . all (
1186- fileList . map ( collectTracedFiles ( nonApiReasons , tracedFiles ) )
1186+ Array . from ( fileList ) . map ( collectTracedFiles ( nonApiReasons , tracedFiles ) )
11871187 ) ;
11881188 await Promise . all (
1189- apiFileList . map ( collectTracedFiles ( apiReasons , apiTracedFiles ) )
1189+ Array . from ( apiFileList ) . map ( collectTracedFiles ( apiReasons , apiTracedFiles ) )
11901190 ) ;
11911191
11921192 if ( hasLambdas ) {
0 commit comments