commit 59e2fc0cbdb1bc4d157b68ac8eb8876165c52b6a
parent 02f21812d652c06f1da3b100b9dbd733370c47d3
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 29 Oct 2026 05:04:41 -0400
umtool: an asset URL a server bundle hands over is kept as its string, not refused at module load
The module registry (modules/index.mjs) brings the page modules into
build-video's static import chain, so chrome-deck.mjs's GSAP_FILE (and
chrome-fx.mjs's FX_MONO_FILE) is evaluated in every umtool page that
imports build-video; Turbopack's asset URL is refused by fileURLToPath
("Received an instance of URL") and `next build` failed collecting page
data for /projects/at. assetFile() keeps fileURLToPath's path in plain
Node and the bundler's string where it refuses.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/umtool/report-to-video/chrome-deck.mjs b/umtool/report-to-video/chrome-deck.mjs
@@ -57,7 +57,28 @@ import { resolveCounter } from "./counter.mjs";
* import.meta in the module that does the fs work would mark every path that
* module joins (scripts/next-build-trace.test.mjs).
*/
-export const GSAP_FILE = fileURLToPath(new URL("./assets/gsap.min.js", import.meta.url));
+export const GSAP_FILE = assetFile(new URL("./assets/gsap.min.js", import.meta.url));
+
+/**
+ * A module's asset URL as a file path. In plain Node it is fileURLToPath's;
+ * in a server bundle Turbopack hands an asset URL object of its own that
+ * fileURLToPath refuses at module load ("Received an instance of URL"),
+ * which failed `next build` while it collected page data once the module
+ * registry (modules/index.mjs) brought the page modules into build-video's
+ * static import chain (docs/quirks.md). There the bundler's own string is
+ * kept: nothing a page bundle evaluates reads the file, and a route that
+ * does gets a real URL, as before.
+ *
+ * @param {URL} url
+ * @returns {string}
+ */
+export function assetFile(url) {
+ try {
+ return fileURLToPath(url);
+ } catch {
+ return String(url);
+ }
+}
/** Instant cues still take a millisecond: a zero-duration tween has its own seek rules. */
const INSTANT = 0.001;
diff --git a/umtool/report-to-video/chrome-fx.mjs b/umtool/report-to-video/chrome-fx.mjs
@@ -16,10 +16,9 @@
// the page: every size is in the data (a screenshot's pixels are read by
// compose-chrome before the page is written). The glitch's noise is a seeded
// generator's (fxRandom), so frame 412 is the same tear on every worker.
-import { fileURLToPath } from "node:url";
import { fxGeometry, pageDuration } from "./deck.mjs";
-import { mix, rgba } from "./chrome-deck.mjs";
+import { assetFile, mix, rgba } from "./chrome-deck.mjs";
import { FX_MOTION, INSTANT, compileCues, fxRandom, noNegZero } from "./fx.mjs";
const esc = (s) =>
@@ -34,7 +33,8 @@ const r2 = (v) => Math.round(v * 100) / 100 || 0;
const r4 = (v) => Math.round(v * 10000) / 10000 || 0;
/** The VHS stamp's mono, vendored beside the brand's faces; copied in as `assets/FxMono.ttf`. */
-export const FX_MONO_FILE = fileURLToPath(new URL("./fonts/IBMPlexMono-Bold.ttf", import.meta.url));
+// Through assetFile (chrome-deck.mjs): a server bundle's asset URL is not fileURLToPath's.
+export const FX_MONO_FILE = assetFile(new URL("./fonts/IBMPlexMono-Bold.ttf", import.meta.url));
/** THEN's colour when the palette names none (`palette.then`), as the flips panel's. */
export const FX_THEN_COLOR = "#6fa8dc";