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 862df6503..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 ${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",