{"record":{"id":"c6f8f14998dcfc54","repo":"cube-js/cube","slug":"drivererror-tostring","errorCode":null,"errorMessage":"driverError.toString()","messagePattern":"driverError\\.toString\\(\\)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"packages/cubejs-server-core/src/core/DevServer.ts","lineNumber":338,"sourceCode":"      });\n    }));\n\n    let driverPromise: Promise<void> | null = null;\n    let driverError: Error | null = null;\n\n    app.get('/playground/driver', catchErrors(async (req: Request, res: Response) => {\n      const { driver } = req.query;\n\n      if (!driver || typeof driver !== 'string' || !DriverDependencies[driver as keyof typeof DriverDependencies]) {\n        return res.status(400).json('Wrong driver');\n      }\n\n      if (packageExists(DriverDependencies[driver as keyof typeof DriverDependencies])) {\n        return res.json({ status: 'installed' });\n      } else if (driverPromise) {\n        return res.json({ status: 'installing' });\n      } else if (driverError) {\n        return res.status(500).json({\n          status: 'error',\n          error: driverError.toString()\n        });\n      }\n\n      return res.json({ status: null });\n    }));\n\n    app.post('/playground/driver', catchErrors((req, res) => {\n      const { driver } = req.body;\n\n      if (!driver || typeof driver !== 'string' || !DriverDependencies[driver as keyof typeof DriverDependencies]) {\n        return res.status(400).json(`'${driver}' driver dependency not found`);\n      }\n\n      const driverKey = driver as keyof typeof DriverDependencies;\n\n      async function installDriver() {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-server-core/src/core/DevServer.ts#L320-L356","documentation":"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.","triggerScenarios":"Thrown at packages/cubejs-server-core/src/core/DevServer.ts:338 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the serialized error in the response to see why the driver package installation failed (network, permissions, missing package).","Retry POST /playground/driver after fixing the underlying install problem to re-trigger installation.","Install the driver package manually (e.g. yarn add @cubejs-backend/<driver>) if npm install keeps failing."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}