From 9c9eeb527997d6abf80c32af293e2e758ecef726 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 20 Oct 2025 12:57:35 +1100 Subject: [PATCH] docs(ci): enable localStorage in Node.js 25 to avoid build error Node.js 25 became "current" and our CI is now testing it. We now have a failure because "localStorage" is now a thing in Node.js but it's not properly enabled without the arg. So @typescript/vfs, which in the browser detects a "localStorage" and tries to use it (but previously in Node.js wouldn't find it so wouldn't try) finds an implementation that's incomplete. This change activates it, so we don't get the error. But we don't really need it, so this can be wound back when we have a fix in vfs or somewhere else in the stack. Ref: https://github.com/nodejs/node/pull/57666 Ref: https://github.com/microsoft/TypeScript-Website/issues/3449 Ref: https://github.com/microsoft/TypeScript-Website/pull/3450 --- docs/.gitignore | 5 ++++- docs/package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index 8732826d..d2172bca 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -20,4 +20,7 @@ pnpm-debug.log* # macOS-specific files .DS_Store src/content/docs/api -.wrangler/ \ No newline at end of file +.wrangler/ + +# Node.js v25 localStorage file +.astro-localstorage.json \ No newline at end of file diff --git a/docs/package.json b/docs/package.json index 7bc4166e..6c2de2b4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,7 +5,7 @@ "private": true, "scripts": { "dev": "astro dev", - "build": "astro build", + "build": "NODE_OPTIONS=\"--localstorage-file=.astro-localstorage.json\" astro build", "preview": "astro preview", "astro": "astro" },