Skip to content

fix(express): disable Node Web Storage in Docker entrypoint - #10245

Open
zahin-mohammad wants to merge 1 commit into
masterfrom
WCN-4966-express-no-webstorage
Open

zahin-mohammad wants to merge 1 commit into
masterfrom
WCN-4966-express-no-webstorage

Conversation

@zahin-mohammad

Copy link
Copy Markdown
Contributor

Important

Stacked on #10244 (Node 26 base image). Merge that first. Node 24 rejects this flag (node: bad option: --no-webstorage) and exits before Express starts, so this must not reach master before the Node 26 image does. When #10244 merges, GitHub will retarget this PR to master.

Summary

Starts the Express container with node --no-webstorage, which removes this warning printed on every boot under Node 26:

(node:7) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.

Why it appears

Node 25+ turns on the Web Storage API (the browser-style localStorage) by default. --trace-warnings shows where it's triggered:

at Object.get (node:internal/webstorage:42:21)
at /var/node_modules/store2/dist/store2.js:264:43

store2 is a browser storage helper. It's pulled in by avalanche@3.15.3 (the deprecated Avalanche library used by sdk-coin-avaxp), and it checks for localStorage when it loads. Express loads every coin module at startup, so the warning prints on every boot.

Why this fix

  • Same behavior as Node 24. With the flag, typeof localStorage is undefined, the same as on Node 24. No BitGoJS source uses localStorage, so turning it off changes nothing functionally.
  • Narrower than the alternatives. --no-warnings=ExperimentalWarning would hide every experimental warning. --localstorage-file would turn on real persistent storage, and store2 would start writing to disk.
  • The flag name. --no-webstorage is the main name in Node 26's --help (--webstorage, --no-experimental-webstorage), so it should keep working if Web Storage stops being experimental.

Not covered

Express run from npm or from source on Node 26, and SDK consumers that load sdk-coin-avaxp, will still see the warning once per process. The real fix is moving sdk-coin-avaxp off avalanche, which touches 45 imports in 10 files. That's out of scope here.

Verification

Rebuilt the image locally (linux/arm64) and ran a 16-request smoke test against it:

  • boot and ping
  • forwarding to BitGo's testnet API
  • encrypt/decrypt round trip
  • local key generation for 9 coins
  • address validation
  • 401 on an unauthenticated wallet call

All 16 pass, and the ExperimentalWarning no longer appears in the container logs.

Ticket: WCN-4966

🤖 Generated with Claude Code

Node 25+ enables the Web Storage API by default. store2 (pulled in by
avalanche@3.15.3 via sdk-coin-avaxp) probes `localStorage` at module
load, which on Node 26 prints on every boot:

  ExperimentalWarning: localStorage is not available because
  --localstorage-file was not provided.

Start node with --no-webstorage so `localStorage` is undefined, matching
Node 24 behaviour. Nothing in BitGoJS uses Web Storage server-side.

Node 24 rejects this flag ("bad option"), so this must ship with or
after the Node 26 base image.

Ticket: WCN-4966

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

WCN-4966

@zahin-mohammad
zahin-mohammad changed the base branch from WCN-4966-express-node-26 to master November 25, 2026 19:13

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants