{"record":{"id":"92ce1c2e20be92c2","repo":"cube-js/cube","slug":"dashboard-app-creating","errorCode":null,"errorMessage":"Dashboard app creating","messagePattern":"Dashboard app creating","errorType":"http","errorClass":null,"httpStatus":404,"severity":"info","filePath":"packages/cubejs-server-core/src/core/DevServer.ts","lineNumber":241,"sourceCode":"      await Promise.all(files.map(file => fs.writeFile(path.join(options.schemaPath, 'cubes', file.fileName), file.content)));\n\n      res.json({ files });\n    }));\n\n    let lastApplyTemplatePackagesError = null;\n\n    app.get('/playground/dashboard-app-create-status', catchErrors(async (req, res) => {\n      const sourcePath = path.join(options.dashboardAppPath, 'src');\n\n      if (lastApplyTemplatePackagesError) {\n        const toThrow = lastApplyTemplatePackagesError;\n        lastApplyTemplatePackagesError = null;\n        throw toThrow;\n      }\n\n      if (this.applyTemplatePackagesPromise) {\n        if (req.query.instant) {\n          res.status(404).json({ error: 'Dashboard app creating' });\n          return;\n        }\n\n        await this.applyTemplatePackagesPromise;\n      }\n\n      // docker-compose share a volume for /dashboard-app and directory will be empty\n      if (!fs.pathExistsSync(options.dashboardAppPath) || fs.readdirSync(options.dashboardAppPath).length === 0) {\n        res.status(404).json({\n          error: `Dashboard app not found in '${path.resolve(options.dashboardAppPath)}' directory`\n        });\n\n        return;\n      }\n\n      if (!fs.pathExistsSync(sourcePath)) {\n        res.status(404).json({\n          error: `Dashboard app corrupted. Please remove '${path.resolve(options.dashboardAppPath)}' directory and recreate it`","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-server-core/src/core/DevServer.ts#L223-L259","documentation":"During initDevEnv (packages/cubejs-server-core/src/core/DevServer.ts:241), the dashboard-app (Playground React app) is generated from template packages. If a request arrives while applyTemplatePackagesPromise is still running and `?instant` is set, the dev server short-circuits with 404 { error: 'Dashboard app creating' } instead of waiting.","triggerScenarios":"Hitting a Playground/dashboard-app URL with ?instant=1 (or the Playground issuing such a request) while the dashboard app template packages are still being applied on startup.","commonSituations":"Opening the Playground immediately after starting a fresh Cube dev server; slow npm installs of dashboard template packages (cold cache, slow network); container startup racing with browser auto-open.","solutions":["Wait for the dev server log indicating the dashboard app is ready, then reload the page","Remove the `instant` query parameter so the request awaits applyTemplatePackagesPromise instead of 404ing","Speed up/retry template package installation (check network, npm registry access, clear npm cache)","Pre-build or persist the dashboard-app directory so regeneration isn't needed on every start"],"exampleFix":"// before\nGET http://localhost:4000/?instant=1\n// after\nGET http://localhost:4000/   (after 'dashboard app is ready' log)","handlingStrategy":"retry","validationCode":"const res = await fetch('/');\nif (res.status === 404 && (await res.text()).includes('Dashboard app creating')) {\n  await new Promise(r => setTimeout(r, 2000)); // then retry\n}","typeGuard":null,"tryCatchPattern":"async function waitForDashboardApp(url, tries = 10) {\n  for (let i = 0; i < tries; i++) {\n    const res = await fetch(url);\n    if (res.ok) return;\n    if (res.status !== 404) throw new Error(`unexpected ${res.status}`);\n    await new Promise(r => setTimeout(r, 2000));\n  }\n  throw new Error('dashboard app never became ready');\n}","preventionTips":["Don't use ?instant=1 until the dashboard app is generated","Wait for the dev-server readiness log before opening the Playground","Ensure npm registry access so template package installation completes quickly"],"tags":["dev-server","playground","race-condition","http-404"],"backgroundTag":"dashboard-app-not-ready","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}