Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(e2e): copy static assets to standalone server to fix playright hydration timeouts

diegosouzapw99b9b9934372
diff --git a/scripts/build-next-isolated.mjs b/scripts/build-next-isolated.mjs
index 68d9acb864..7d0a116aaa 100644
--- a/scripts/build-next-isolated.mjs
+++ b/scripts/build-next-isolated.mjs
@@ -62,6 +62,23 @@ async function main() {
}
const result = await runNextBuild();
+ if (result.code === 0 && (await exists(path.join(projectRoot, ".next", "standalone")))) {
+ console.log("[build-next-isolated] Copying static assets for standalone server...");
+ try {
+ await fs.cp(
+ path.join(projectRoot, "public"),
+ path.join(projectRoot, ".next", "standalone", "public"),
+ { recursive: true }
+ );
+ await fs.cp(
+ path.join(projectRoot, ".next", "static"),
+ path.join(projectRoot, ".next", "standalone", ".next", "static"),
+ { recursive: true }
+ );
+ } catch (copyErr) {
+ console.warn("[build-next-isolated] Non-fatal error copying static assets:", copyErr);
+ }
+ }
process.exitCode = result.code;
} catch (error) {
console.error("[build-next-isolated] Build failed:", error);