File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
packages/cli/src/services Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -210,13 +210,18 @@ export async function bundlePlayWrightProject (
210210 const output = fsSync . createWriteStream ( outputFile )
211211
212212 // Dynamic import for CommonJs so it doesn't break when using checkly/playwright-reporter archiver
213- const { default : archiver } = await import ( 'archiver' )
214- const archive = archiver ( 'tar' , {
215- gzip : true ,
216- gzipOptions : {
217- level : 9 ,
218- } ,
219- } )
213+ // The custom Checkly fork of archiver exports TarArchive class instead of a default function
214+ const archiverModule : any = await import ( 'archiver' )
215+ let archive : Archiver
216+ if ( archiverModule . TarArchive ) {
217+ // Using Checkly's custom fork which exports TarArchive class
218+ archive = new archiverModule . TarArchive ( { gzip : true , gzipOptions : { level : 9 } } )
219+ } else if ( archiverModule . default ) {
220+ // Using standard archiver which has a default factory function
221+ archive = archiverModule . default ( 'tar' , { gzip : true , gzipOptions : { level : 9 } } )
222+ } else {
223+ throw new Error ( 'Unable to initialize archiver: neither TarArchive nor default export found' )
224+ }
220225 archive . pipe ( output )
221226
222227 const pwConfigParsed = new PlaywrightConfig ( filePath , pwtConfig )
You can’t perform that action at this time.
0 commit comments