You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The zip command prints "Could not get stats" warnings when the sources root is not the extension folder #2626
pnpm monorepo. Each extension is in extensions/<name>, and the sources zip is configured to include the workspace root so reviewers can rebuild it (packages/shared, root package.json, lockfile):
git clone https://github.com/pigfox/browser-extensions && cd browser-extensions (commit 65017d5)
pnpm install
pnpm zip (this runs wxt zip -b firefox in each extensions/<name> folder)
Actual
For each extension, the sources step logs one warning per file in the zip:
WARN Could not get stats of 'LICENSE' error: Error: ENOENT: no such file or directory, lstat 'LICENSE'
WARN Could not get stats of 'extensions/ghost-job-detector/package.json' error: Error: ENOENT: no such file or directory, lstat 'extensions/ghost-job-detector/package.json'
The sources zip has 20 files, and 19 of them get this warning per extension (76 across the four extensions). The one without a warning is package.json, and only because a different file with that name exists in the extension folder. So its reported size is the extension's package.json, not the root one that was zipped.
Expected
No warnings, and correct sizes in the file list.
The zips themselves are correct: rebuilding each extension from its sources zip gives a Firefox build that is byte-for-byte identical. Only the log output is wrong.
Likely cause (as observed)
In zip.ts, printFileList(..., wxt.config.zip.sourcesRoot, files) receives file paths relative to sourcesRoot. But printFileList calls lstat(file) on those relative paths without resolving them against baseDir. They end up resolved against process.cwd() (the extension folder), not the sources root. Resolving with path.resolve(baseDir, file) before lstat would fix it.
Activity