From 452018e7059791d9cf254d9e2f4e61b4c6442d55 Mon Sep 17 00:00:00 2001 From: evolv3ai Date: Mon, 27 Jul 2026 12:30:51 -0500 Subject: [PATCH 1/2] fix(editor): use a literal dev port so `bun dev` works on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, `bun run` executes package scripts with Bun's own built-in shell rather than a POSIX shell. That shell does not implement default-value parameter expansion, so `${PORT:-3002}` is passed through to Next.js verbatim and the dev server exits immediately: error: option '-p, --port ' argument '${PORT:-3002}' is invalid. '${PORT:-3002}' is not a non-negative number. Setting PORT in the environment does not help — the literal is never expanded either way. Replace the expansion with the documented default port (3002). Co-Authored-By: Claude Opus 5 --- apps/editor/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/editor/package.json b/apps/editor/package.json index 862df6503..c06a4a56e 100644 --- a/apps/editor/package.json +++ b/apps/editor/package.json @@ -4,7 +4,7 @@ "type": "module", "private": true, "scripts": { - "dev": "dotenv -e ../../.env.local -- next dev --port ${PORT:-3002}", + "dev": "dotenv -e ../../.env.local -- next dev --port 3002", "build": "dotenv -e ../../.env.local -- next build", "start": "next start", "lint": "biome lint", From 76add12919b4cee8348df43f1e4183038133ed1a Mon Sep 17 00:00:00 2001 From: evolv3ai Date: Mon, 27 Jul 2026 17:21:48 -0500 Subject: [PATCH 2/2] fix(editor): serve MCP `editorUrl` paths and pin the dev server hostname The scene store hands out `/editor/` as a project's canonical URL (`editorUrlForScene` in packages/mcp/src/storage/sqlite-scene-store.ts) and `/api/scenes` reports it verbatim, but this app only routes `/scene/[id]`. Every MCP-reported `editorUrl` therefore 404s. Rewrite `/editor/:id` to `/scene/:id` rather than redirect: client code parses the project id back out of the browser path (scan upload in packages/editor/src/components/ui/action-menu/view-toggles.tsx), so the `/editor/` prefix has to survive the hop. `/scene/` keeps working for the app's own links, and the MCP-side tests asserting `/editor/` stay valid, so no test or storage changes are needed. Also pass `--hostname 0.0.0.0` explicitly to `next dev`. Next already binds every interface by default, so this pins that behaviour rather than changing it, and surfaces the Network URL in dev output. Reaching the dev server from another device still requires an inbound firewall rule for port 3002. Co-Authored-By: Claude Opus 5 --- apps/editor/next.config.ts | 12 ++++++++++++ apps/editor/package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/editor/next.config.ts b/apps/editor/next.config.ts index 18fb18206..d01630cb9 100644 --- a/apps/editor/next.config.ts +++ b/apps/editor/next.config.ts @@ -4,6 +4,18 @@ const nextConfig: NextConfig = { logging: { browserToTerminal: true, }, + // The scene store hands out `/editor/` as the canonical project URL + // (`packages/mcp/src/storage/sqlite-scene-store.ts` `editorUrlForScene`), and + // the hosted product serves that path. This app names its route `/scene/[id]`, + // so every MCP-reported `editorUrl` 404s here. + // + // Rewrite rather than redirect: the browser path has to keep the `/editor/` + // prefix because client code parses the project id back out of it (see + // `packages/editor/src/components/ui/action-menu/view-toggles.tsx`, scan + // upload). `/scene/` keeps working for the app's own links. + async rewrites() { + return [{ source: '/editor/:id', destination: '/scene/:id' }] + }, typescript: { ignoreBuildErrors: true, }, diff --git a/apps/editor/package.json b/apps/editor/package.json index c06a4a56e..6818c59d1 100644 --- a/apps/editor/package.json +++ b/apps/editor/package.json @@ -4,7 +4,7 @@ "type": "module", "private": true, "scripts": { - "dev": "dotenv -e ../../.env.local -- next dev --port 3002", + "dev": "dotenv -e ../../.env.local -- next dev --hostname 0.0.0.0 --port 3002", "build": "dotenv -e ../../.env.local -- next build", "start": "next start", "lint": "biome lint",