cube-js/cube · info

Dashboard app creating

Error message

Dashboard app creating

What it means

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.

Source

Thrown at packages/cubejs-server-core/src/core/DevServer.ts:241

      await Promise.all(files.map(file => fs.writeFile(path.join(options.schemaPath, 'cubes', file.fileName), file.content)));

      res.json({ files });
    }));

    let lastApplyTemplatePackagesError = null;

    app.get('/playground/dashboard-app-create-status', catchErrors(async (req, res) => {
      const sourcePath = path.join(options.dashboardAppPath, 'src');

      if (lastApplyTemplatePackagesError) {
        const toThrow = lastApplyTemplatePackagesError;
        lastApplyTemplatePackagesError = null;
        throw toThrow;
      }

      if (this.applyTemplatePackagesPromise) {
        if (req.query.instant) {
          res.status(404).json({ error: 'Dashboard app creating' });
          return;
        }

        await this.applyTemplatePackagesPromise;
      }

      // docker-compose share a volume for /dashboard-app and directory will be empty
      if (!fs.pathExistsSync(options.dashboardAppPath) || fs.readdirSync(options.dashboardAppPath).length === 0) {
        res.status(404).json({
          error: `Dashboard app not found in '${path.resolve(options.dashboardAppPath)}' directory`
        });

        return;
      }

      if (!fs.pathExistsSync(sourcePath)) {
        res.status(404).json({
          error: `Dashboard app corrupted. Please remove '${path.resolve(options.dashboardAppPath)}' directory and recreate it`

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Wait for the dev server log indicating the dashboard app is ready, then reload the page
  2. Remove the `instant` query parameter so the request awaits applyTemplatePackagesPromise instead of 404ing
  3. Speed up/retry template package installation (check network, npm registry access, clear npm cache)
  4. Pre-build or persist the dashboard-app directory so regeneration isn't needed on every start

Example fix

// before
GET http://localhost:4000/?instant=1
// after
GET http://localhost:4000/   (after 'dashboard app is ready' log)
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch('/');
if (res.status === 404 && (await res.text()).includes('Dashboard app creating')) {
  await new Promise(r => setTimeout(r, 2000)); // then retry
}

Try / catch

async function waitForDashboardApp(url, tries = 10) {
  for (let i = 0; i < tries; i++) {
    const res = await fetch(url);
    if (res.ok) return;
    if (res.status !== 404) throw new Error(`unexpected ${res.status}`);
    await new Promise(r => setTimeout(r, 2000));
  }
  throw new Error('dashboard app never became ready');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/92ce1c2e20be92c2. Report an issue: GitHub.