Skip to content

xlsx is pinned to a CDN tarball, which breaks installs in restricted environments #3

Description

@jstet

The problem

package.json pins the runtime dependency as

"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"

A non-registry URL in dependencies makes installing this package impossible in
any environment that restricts remote tarball fetches. Two independent reports so
far:

Why the obvious workarounds do not help

Both consumer-side theories floated so far are wrong, and worth writing down so
nobody implements them:

  • "Commit dist/ (like @correlaid/cdl-design)." That removes the need to
    run our prepare script, but xlsx is a runtime dependency — the consumer's
    installer still has to fetch that tarball. A committed dist/ does not change
    the failure.
  • "Ship a release artifact." Same reasoning. Unless the artifact bundles
    xlsx, the dependency still resolves from the CDN at install time.

So this is not a packaging problem; it is a dependency-source problem.

Options

  1. Move to the npm-registry xlsx. SheetJS stopped publishing to npm after
    0.18.5, so this means pinning xlsx@^0.18.5 — an older SheetJS. Cheapest fix,
    restores plain npm install, and CorrelAid/formtransform-app and
    CorrelAid/formulaid already depend on xlsx@^0.18.5 themselves, so they would
    also stop carrying two copies. Risk: a behavioural difference between 0.18.5
    and 0.20.3 in workbook parsing. The contract suite (npm run test:contract)
    plus the blessed snapshots should catch that — if all 707 vitest tests and the
    pyxform oracle pass on 0.18.5, the risk is close to zero for our read paths
    (XLSX.read, XLSX.write).
  2. Vendor the SheetJS tarball into the repo and depend on a file: path.
    Keeps 0.20.3, works offline, but adds ~1 MB of binary to git and a manual
    update path.
  3. Make it a peer dependency and let each consumer bring its own xlsx. Honest
    about the fact that consumers already have one, but it pushes the CDN problem
    onto them and breaks the CLI's standalone install.
  4. Do nothing, document it. Consumers pass --allow-remote=all (npm) or the
    bun equivalent. Cheapest today, but every new consumer rediscovers it, and it
    will keep breaking locked-down CI.

Recommendation

Option 1, gated on the test suite. Concretely: switch the pin to xlsx@^0.18.5,
run npm test (707 tests), npm run test:py and npm run bless with no diff
expected in the blessed snapshots. If any snapshot moves, stop and reconsider —
that difference is exactly what we would be shipping to consumers.

Whoever picks this up: report the test results before changing the pin
permanently, and update the install instructions in README.md either way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions