{"record":{"id":"80e13f933d1aaed2","repo":"pubkey/rxdb","slug":"ut5","errorCode":"UT5","errorMessage":"\n        RxDB Error-Code: ${message}.\n        Hint: Error messages are not included in RxDB core to reduce build size.\n        To show the full error messages and to ensure that you do not make any mistakes when using RxDB,\n        use the dev-mode plugin when you are in development mode: https://rxdb.info/dev-mode.html?console=error\n        \nFind out more about this error here: https://rxdb.info/errors.html?console=errors#UT5 \nStill stuck? Ask in the RxDB Discord: https://rxdb.info/chat \n","messagePattern":"\n        RxDB Error-Code: (.+?)\\.\n        Hint: Error messages are not included in RxDB core to reduce build size\\.\n        To show the full error messages and to ensure that you do not make any mistakes when using RxDB,\n        use the dev-mode plugin when you are in development mode: https://rxdb\\.info/dev-mode\\.html\\?console=error\n        \nFind out more about this error here: https://rxdb\\.info/errors\\.html\\?console=errors#UT5 \nStill stuck\\? Ask in the RxDB Discord: https://rxdb\\.info/chat \n","errorType":"error_code","errorClass":"RxError","httpStatus":null,"severity":"error","filePath":"src/rx-storage-helper.ts","lineNumber":874,"sourceCode":"        changeStream() {\n            return storageInstance.changeStream();\n        }\n    };\n\n    database.storageInstances.add(ret);\n    return ret;\n}\n\n/**\n * Each RxStorage implementation should\n * run this method at the first step of createStorageInstance()\n * to ensure that the configuration is correct.\n */\nexport function ensureRxStorageInstanceParamsAreCorrect(\n    params: RxStorageInstanceCreationParams<any, any>\n) {\n    if (params.schema.keyCompression) {\n        throw newRxError('UT5', { args: { params } });\n    }\n    if (hasEncryption(params.schema)) {\n        throw newRxError('UT6', { args: { params } });\n    }\n    if (\n        params.schema.attachments &&\n        params.schema.attachments.compression\n    ) {\n        throw newRxError('UT7', { args: { params } });\n    }\n}\n\nexport function hasEncryption(jsonSchema: RxJsonSchema<any>): boolean {\n    if (\n        (!!jsonSchema.encrypted && jsonSchema.encrypted.length > 0) ||\n        (jsonSchema.attachments && jsonSchema.attachments.encrypted)\n    ) {\n        return true;","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-storage-helper.ts#L856-L892","documentation":"UT5 (UT = 'ensureRxStorageInstanceParamsAreCorrect' utility checks) is thrown when a collection is created with keyCompression enabled in its schema but the target RxStorage implementation does not support the key-compression plugin's storage requirements. ensureRxStorageInstanceParamsAreCorrect (src/rx-storage-helper.ts:874) guards storage instance creation so misconfiguration fails fast instead of producing corrupt or unusable data in storages that only work with plain (non-compressed) keys.","triggerScenarios":"Calling createRxCollection()/addCollections() with a schema where keyCompression: true while using an RxStorage that rejects compressed params (this check runs for storages that require plain params, e.g. when key compression plugin is not installed or the storage does not handle compression).","commonSituations":"Copying a schema from a project that used key compression into a new project without the compression plugin; enabling keyCompression to save disk space while switching to a storage (e.g. certain remote or premium storages) that does not support it; upgrading RxDB and moving collection creation to a storage path that now runs the params guard.","solutions":["Set keyCompression: false in the schema (or remove the flag) if you do not actively need key compression.","Install and register the key-compression plugin if you want keyCompression: true, and use a storage that supports it.","If compression matters, pick a storage that handles it natively or use a storage with built-in compression instead of schema-level keyCompression.","Remember schemas are immutable per collection: for an existing collection, create a new collection/version with a migration instead of editing the live schema."],"exampleFix":"// before\nconst mySchema = {\n  title: 'hero',\n  version: 0,\n  keyCompression: true,\n  primaryKey: 'id',\n  properties: { id: { type: 'string', maxLength: 100 } },\n  required: ['id']\n};\n\n// after\nconst mySchema = {\n  title: 'hero',\n  version: 0,\n  keyCompression: false,\n  primaryKey: 'id',\n  properties: { id: { type: 'string', maxLength: 100 } },\n  required: ['id']\n};","handlingStrategy":"validation","validationCode":"// check before creating the collection\nif (mySchema.keyCompression === true) {\n  // either remove the flag or ensure the key-compression plugin is registered\n  console.warn('keyCompression is enabled; ensure the compression plugin is added');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await myRxDatabase.addCollections({ heroes: { schema: mySchema } });\n} catch (err) {\n  if (err && err.code === 'UT5') {\n    console.error('keyCompression enabled but storage does not support it:', err.parameters.args.params.schema.title);\n    // recreate with keyCompression: false or install the plugin\n    return;\n  }\n  throw err;\n}","preventionTips":["Only set keyCompression: true when you actually installed the key-compression plugin and use a supporting storage.","Keep a single shared schema module per project so schemas copied between projects stay consistent.","Create collections early in app startup (fail fast) instead of lazily deep inside features.","Add a startup assertion that logs err.code for any RxError during collection creation."],"tags":["configuration","schema","storage"],"backgroundTag":"incompatible-storage-config","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}