From 8c3ec5b8d0c3e37af1275c98a5831a3e4b5627ef Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 21 Oct 2026 09:24:30 +0200 Subject: [PATCH] Print Pyodide errors without the minified source line --- tests/pyodide/run.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/pyodide/run.mjs b/tests/pyodide/run.mjs index 0f6c6ff..27d9c76 100644 --- a/tests/pyodide/run.mjs +++ b/tests/pyodide/run.mjs @@ -3,6 +3,14 @@ import { readFile } from "node:fs/promises"; import { basename } from "node:path"; import { loadPyodide } from "pyodide"; +// Node's default report of an uncaught error starts with the throwing source +// line. Inside Pyodide that is one ~65 KB minified line of pyodide.asm.mjs, +// which GitHub truncates together with the error message after it. +process.on("uncaughtException", (error) => { + console.error(error?.stack ?? error); + process.exit(1); +}); + const [wheel] = process.argv.slice(2); if (!wheel || process.argv.length !== 3 || !wheel.endsWith("-py3-none-any.whl")) { throw new Error("Usage: node run.mjs /path/to/cunumpy-VERSION-py3-none-any.whl");