{"record":{"id":"3d14319a64adc989","repo":"pubkey/rxdb","slug":"db9","errorCode":"DB9","errorMessage":"RxDB Error-Code: DB9. Hint: Error messages are not included in RxDB core to reduce build size. To show the full error messages and to ensure that you do not make any mistakes when using RxDB, use the dev-mode plugin when you are in development mode: https://rxdb.info/dev-mode.html?console=error","messagePattern":"RxDB Error-Code: DB9\\. Hint: Error messages are not included in RxDB core to reduce build size\\. To show the full error messages and to ensure that you do not make any mistakes when using RxDB, use the dev-mode plugin when you are in development mode: https://rxdb\\.info/dev-mode\\.html\\?console=error","errorType":"error_code","errorClass":"RxError","httpStatus":null,"severity":"error","filePath":"src/rx-database.ts","lineNumber":857,"sourceCode":"    };\n\n    databaseNameKeyUnclosedInstancesSet.add(instancePromiseWithResolvers.promise as any as Promise<RxDatabase>);\n    DATABASE_UNCLOSED_INSTANCE_PROMISE_MAP.set(databaseNameKey, databaseNameKeyUnclosedInstancesSet);\n\n    (async () => {\n        if (closeDuplicates) {\n            await Promise.all(\n                closeDuplicatesPromises.map((unclosedInstancePromise) =>\n                    unclosedInstancePromise\n                        .catch(() => null)\n                        .then((instance) => instance && instance.close())\n                )\n            );\n        }\n\n        if (ignoreDuplicate) {\n            if (!overwritable.isDevMode()) {\n                throw newRxError('DB9', {\n                    database: name\n                });\n            }\n        } else {\n            // check if combination already used\n            throwIfDatabaseNameUsed(name, storage);\n        }\n\n        USED_DATABASE_NAMES.add(databaseNameKey);\n\n        const databaseInstanceToken = randomToken(10);\n        const storageInstance = await createRxDatabaseStorageInstance<\n            Internals,\n            InstanceCreationOptions\n        >(\n            databaseInstanceToken,\n            storage,\n            name,","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-database.ts#L839-L875","documentation":"DB9 is thrown when you pass { ignoreDuplicate: true } to createRxDatabase() while the dev-mode plugin is not enabled. The ignoreDuplicate option is a dev-only convenience for hot reloading, so RxDB refuses it in production builds to prevent silently sharing an underlying storage between database instances. Enable the dev-mode plugin to use it during development.","triggerScenarios":"Calling createRxDatabase({ name, storage, ignoreDuplicate: true }) without adding the dev-mode plugin via addRxPlugin(RxDBDevModePlugin), or with it enabled only conditionally in a production build.","commonSituations":"Copy-pasting hot-reload example code into a production build; toggling dev-mode plugin per environment so production hits this path; forgetting to register RxDBDevModePlugin after adding ignoreDuplicate.","solutions":["Remove ignoreDuplicate from createRxDatabase options in production code.","If it is dev-only tooling, register the dev-mode plugin: addRxPlugin(RxDBDevModePlugin) when process.env.NODE_ENV !== 'production'.","Reuse a singleton database instance instead of relying on ignoreDuplicate."],"exampleFix":"// before\nconst db = await createRxDatabase({ name: 'mydb', storage, ignoreDuplicate: true });\n// after\nimport { RxDBDevModePlugin } from 'rxdb/plugins/dev-mode';\nif (process.env.NODE_ENV !== 'production') {\n  addRxPlugin(RxDBDevModePlugin);\n}\nconst db = await createRxDatabase({\n  name: 'mydb',\n  storage,\n  ...(process.env.NODE_ENV !== 'production' ? { ignoreDuplicate: true } : {})\n});","handlingStrategy":"validation","validationCode":"import { RxDBDevModePlugin } from 'rxdb/plugins/dev-mode';\nimport { addRxPlugin } from 'rxdb';\nconst isDev = process.env.NODE_ENV !== 'production';\nif (isDev) addRxPlugin(RxDBDevModePlugin);\nif (!isDev && options.ignoreDuplicate) {\n  throw new Error('ignoreDuplicate is only allowed in dev mode');\n}","typeGuard":"function isIgnoreDuplicateAllowed(isDevMode, options) {\n  return !options.ignoreDuplicate || isDevMode === true;\n}","tryCatchPattern":"try {\n  db = await createRxDatabase(options);\n} catch (err) {\n  if (String(err?.code) === 'DB9') {\n    // ignoreDuplicate without dev-mode plugin: drop the option and retry\n    const { ignoreDuplicate, ...rest } = options;\n    db = await createRxDatabase(rest);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Only pass ignoreDuplicate in code paths gated behind NODE_ENV development checks.","Register RxDBDevModePlugin in the same environment gate as ignoreDuplicate usage.","Prefer singleton database instances over ignoreDuplicate for hot reloading.","Never ship ignoreDuplicate in production bundles."],"tags":["database","dev-mode","configuration"],"backgroundTag":"dev-only-option-in-production","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}