cube-js/cube · error

driverError.toString()

Error message

driverError.toString()

What it means

Not a thrown error: in DevServer.initDevEnv, the GET /playground/driver endpoint serializes the stored driverError (from a failed background npm install of a Cube driver package) into a 500 JSON response with status 'error', reporting why the driver install failed to the playground.

Source

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

      });
    }));

    let driverPromise: Promise<void> | null = null;
    let driverError: Error | null = null;

    app.get('/playground/driver', catchErrors(async (req: Request, res: Response) => {
      const { driver } = req.query;

      if (!driver || typeof driver !== 'string' || !DriverDependencies[driver as keyof typeof DriverDependencies]) {
        return res.status(400).json('Wrong driver');
      }

      if (packageExists(DriverDependencies[driver as keyof typeof DriverDependencies])) {
        return res.json({ status: 'installed' });
      } else if (driverPromise) {
        return res.json({ status: 'installing' });
      } else if (driverError) {
        return res.status(500).json({
          status: 'error',
          error: driverError.toString()
        });
      }

      return res.json({ status: null });
    }));

    app.post('/playground/driver', catchErrors((req, res) => {
      const { driver } = req.body;

      if (!driver || typeof driver !== 'string' || !DriverDependencies[driver as keyof typeof DriverDependencies]) {
        return res.status(400).json(`'${driver}' driver dependency not found`);
      }

      const driverKey = driver as keyof typeof DriverDependencies;

      async function installDriver() {

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Read the serialized error in the response to see why the driver package installation failed (network, permissions, missing package).
  2. Retry POST /playground/driver after fixing the underlying install problem to re-trigger installation.
  3. Install the driver package manually (e.g. yarn add @cubejs-backend/<driver>) if npm install keeps failing.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cubejs-server-core/src/core/DevServer.ts:338 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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