client/package.json overrides exceljs's archiver to ^8.0.0 (added with the 7.14.0 release). exceljs calls archiver as a callable - lib/stream/xlsx/workbook-writer.js:50: this.zip = Archiver('zip', this.zipOptions) on a CJS require('archiver') - and archiver 8 is an ESM package that exports only the classes (Archiver, ZipArchive, TarArchive, JsonArchive) with no callable default.
So the streamed xlsx writer throws:
$ node scripts/probe-xlsx.mjs
streamed write FAILED: Archiver is not a function
The client imports exceljs dynamically in the browser bundle (src/app/shared/hot-export/hot-export.util.ts:115) and hands the workbook to the download plugin, so the shipped Excel export never runs exceljs under Node. The breakage is confined to Node-side use of exceljs - any tooling, script, test or future server-side export.
Why it is worth fixing anyway
Any Node script that writes a workbook through exceljs is broken with a confusing error.
The override exists to keep a single archiver in the tree; archiver 8 is ESM-only, so the pairing needs either a CJS-compatible archiver (7.x) or an exceljs version that handles the ESM default export.
Reproduce
cd client
npm ci
node -e "const E=require('exceljs'); new E.stream.xlsx.WorkbookWriter({filename:'/tmp/x.xlsx'})"
Found while adding a guard for the readdir-glob/minimatch override in #414; recorded separately because it predates that change.
## What
`client/package.json` overrides exceljs's archiver to `^8.0.0` (added with the 7.14.0 release). exceljs calls archiver as a callable - `lib/stream/xlsx/workbook-writer.js:50`: `this.zip = Archiver('zip', this.zipOptions)` on a CJS `require('archiver')` - and archiver 8 is an ESM package that exports only the classes (`Archiver`, `ZipArchive`, `TarArchive`, `JsonArchive`) with no callable default.
So the streamed xlsx writer throws:
```
$ node scripts/probe-xlsx.mjs
streamed write FAILED: Archiver is not a function
```
with
```js
const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({ filename: out, useStyles: true })
```
## Why it does not affect the app today
The client imports exceljs dynamically in the browser bundle (`src/app/shared/hot-export/hot-export.util.ts:115`) and hands the workbook to the download plugin, so the shipped Excel export never runs exceljs under Node. The breakage is confined to Node-side use of exceljs - any tooling, script, test or future server-side export.
## Why it is worth fixing anyway
- Any Node script that writes a workbook through exceljs is broken with a confusing error.
- The override exists to keep a single archiver in the tree; archiver 8 is ESM-only, so the pairing needs either a CJS-compatible archiver (7.x) or an exceljs version that handles the ESM default export.
## Reproduce
```bash
cd client
npm ci
node -e "const E=require('exceljs'); new E.stream.xlsx.WorkbookWriter({filename:'/tmp/x.xlsx'})"
```
Found while adding a guard for the readdir-glob/minimatch override in #414; recorded separately because it predates that change.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
client/package.jsonoverrides exceljs's archiver to^8.0.0(added with the 7.14.0 release). exceljs calls archiver as a callable -lib/stream/xlsx/workbook-writer.js:50:this.zip = Archiver('zip', this.zipOptions)on a CJSrequire('archiver')- and archiver 8 is an ESM package that exports only the classes (Archiver,ZipArchive,TarArchive,JsonArchive) with no callable default.So the streamed xlsx writer throws:
with
Why it does not affect the app today
The client imports exceljs dynamically in the browser bundle (
src/app/shared/hot-export/hot-export.util.ts:115) and hands the workbook to the download plugin, so the shipped Excel export never runs exceljs under Node. The breakage is confined to Node-side use of exceljs - any tooling, script, test or future server-side export.Why it is worth fixing anyway
Reproduce
Found while adding a guard for the readdir-glob/minimatch override in #414; recorded separately because it predates that change.