Skip to content

Commit d9f5587

Browse files
committed
fix(webui): the native acceptance host serves the split bundle's chunks
The native-browser-host copied index.html, client.js and styles.css into its temp clientDir and nothing else. The split bundle's entry imports its chunks from /assets/ — a copy without the directory cannot boot at all, so the PTY acceptance test died waiting for #webui-root (reproduced on the ubuntu CI twice; the app boots the moment the directory is copied). The directory is now copied wholesale, matching what the loopback resolver serves and the packaged release ships.
1 parent 44d7f80 commit d9f5587

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/webui/test/browser/support/native-browser-host.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Browser acceptance host: real assembly, loopback service and native PTYs.
2-
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
2+
import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
33
import { tmpdir } from "node:os";
44
import path from "node:path";
55
import { fileURLToPath } from "node:url";
@@ -26,6 +26,11 @@ for (const name of ["index.html", "client.js", "styles.css"]) {
2626
`<script>window.__WEBUI_TEST_SERVER_ID__=${JSON.stringify(process.env.WEBUI_BROWSER_SERVER_ID)};</script></head>`));
2727
await writeFile(path.join(clientDir, name), body);
2828
}
29+
// The split bundle's chunks live under assets/ — the entry imports them, so a
30+
// copy without the directory cannot boot at all (#webui-root never appears).
31+
// Copy it wholesale, matching what the loopback resolver serves and the
32+
// packaged release ships.
33+
await cp(path.join(root, "dist-webui/client/assets"), path.join(clientDir, "assets"), { recursive: true });
2934
const assembled = await createWebuiRuntimeHost({
3035
dataDir: directory, appVersion: "webui-native-acceptance",
3136
mcodeTools: { prepare: async () => ({ requested: false, ready: false, category: "disabled" as const,

0 commit comments

Comments
 (0)