{"record":{"id":"05650e87d51bf165","repo":"diegosouzapw/OmniRoute","slug":"db-nenhum-driver-sqlite-dispon-vel-para-sqlit","errorCode":null,"errorMessage":"[DB] Nenhum driver SQLite disponível para '${sqliteFile}'. Drivers testados: ${syncDrivers}, sql.js (falhou: ${preInitError}).","messagePattern":"\\[DB\\] Nenhum driver SQLite disponível para '(.+?)'\\. Drivers testados: (.+?), sql\\.js \\(falhou: (.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/db/core.ts","lineNumber":207,"sourceCode":"  if (adapter.open) adapter.close();\n}\n\nfunction openSqliteDatabase(sqliteFile: string, options?: Record<string, unknown>): SqliteDatabase {\n  const adapter = tryOpenSync(sqliteFile, options);\n  if (adapter) return adapter;\n\n  const sqlJs = getSqlJsAdapter(sqliteFile);\n  if (sqlJs) return sqlJs;\n\n  // sql.js pre-init was genuinely attempted (e.g. by the top-level eager\n  // barrier below) and failed — surface the real cause instead of the\n  // generic/misleading \"not pre-initialized yet\" message (#7288).\n  const preInitError = getSqlJsPreInitError(sqliteFile);\n  const syncDrivers = process.versions.bun\n    ? \"bun:sqlite (failed)\"\n    : \"better-sqlite3 (failed), node:sqlite (unavailable)\";\n  if (preInitError) {\n    throw new Error(\n      `[DB] Nenhum driver SQLite disponível para '${sqliteFile}'. ` +\n        `Drivers testados: ${syncDrivers}, ` +\n        `sql.js (falhou: ${preInitError}).`\n    );\n  }\n\n  throw new Error(\n    `[DB] Nenhum driver SQLite disponível para '${sqliteFile}'. ` +\n      \"Chame ensureDbInitialized() no startup. \" +\n      `Drivers testados: ${syncDrivers}. ` +\n      \"sql.js WASM ainda não foi pré-inicializado.\"\n  );\n}\n\n// Ensure data directory exists — with fallback for restricted home directories (#133)\nif (!isCloud && !fs.existsSync(DATA_DIR)) {\n  try {\n    fs.mkdirSync(DATA_DIR, { recursive: true });","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/core.ts#L189-L225","documentation":"Error \"[DB] Nenhum driver SQLite disponível para '${sqliteFile}'. Drivers testados: ${syncDrivers}, sql.js (falhou: ${preInitError}).\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/core.ts:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}