RxDB Error Messages
When RxDB has an error, an RxError
object is thrown instead of a normal JavaScript Error
. This RxError
contains additional properties such as a code
field and parameters
. By default the full human readable error messages are not included into the RxDB build. This is because error messages have a high entropy and cannot be compressed well. Therefore only an error message with the correct error-code and parameters is thrown but without the full text.
When you enable the DevMode Plugin the full error messages are added to the RxError
. This should only be done in development, not in production builds to keep a small build size.
All RxDB error messages​
Code: UT1
Given name is no string or emptyCode: UT2
Collection- and database-names must match the regex to be compatible with couchdb databases. See https://neighbourhood.ie/blog/2020/10/13/everything-you-need-to-know-about-couchdb-database-names/ info: if your database-name specifies a folder, the name must contain the slash-char '/' or '\'Code: UT3
Replication-direction must either be push or pull or both. But not noneCode: UT4
Given leveldown is no valid adapterCode: UT5
KeyCompression is set to true in the schema but no key-compression handler is used in the storageCode: UT6
Schema contains encrypted fields but no encryption handler is used in the storageCode: UT7
Attachments.compression is enabled but no attachment-compression plugin is usedCode: PL1
Given plugin is not RxDB plugin.Code: PL3
A plugin with the same name was already added but it was not the exact same JavaScript objectCode: P2
BulkWrite() cannot be called with an empty arrayCode: QU1
RxQuery._execOverDatabase(): op not knownCode: QU4
RxQuery.regex(): You cannot use .regex() on the primary fieldCode: QU5
RxQuery.sort(): does not work because key is not defined in the schemaCode: QU6
RxQuery.limit(): cannot be called on .findOne()Code: QU9
ThrowIfMissing can only be used in findOne queriesCode: QU10
Result empty and throwIfMissing: trueCode: QU11
RxQuery: no valid query params givenCode: QU12
Given index is not in schemaCode: QU13
A top level field of the query is not included in the schemaCode: QU14
Running a count() query in slow mode is now allowed. Either run a count() query with a selector that fully matches an index or set allowSlowCount=true when calling the createRxDatabaseCode: QU15
For count queries it is not allowed to use skip or limitCode: QU16
$regex queries must be defined by a string, not an RegExp instance. This is because RegExp objects cannot be JSON stringified and also they are mutable which would be dangerousCode: QU17
Chained queries cannot be used on findByIds() RxQuery instancesCode: QU18
Malformated query result data. This likely happens because you create a OPFS-storage RxDatabase inside of a worker but did not set the usesRxDatabaseInWorker setting. https://rxdb.info/rx-storage-opfs.html#setting-usesrxdatabaseinworker-when-a-rxdatabase-is-also-used-inside-of-the-workerCode: MQ1
Path must be a string or objectCode: MQ2
Invalid argumentCode: MQ3
Invalid sort() argument. Must be a string, object, or arrayCode: MQ4
Invalid argument. Expected instanceof mquery or plain objectCode: MQ5
Method must be used after where() when called with these argumentsCode: MQ6
Can't mix sort syntaxes. Use either array or object | .sort([['field', 1], ['test', -1]]) | .sort({ field: 1, test: -1 })Code: MQ7
Invalid sort valueCode: MQ8
Can't mix sort syntaxes. Use either array or objectCode: DB1
RxDocument.prepare(): another instance on this adapter has a different passwordCode: DB2
RxDatabase.addCollections(): collection-names cannot start with underscore _Code: DB3
RxDatabase.addCollections(): collection already exists. use myDatabase[collectionName] to get itCode: DB4
RxDatabase.addCollections(): schema is missingCode: DB5
RxDatabase.addCollections(): collection-name not allowedCode: DB6
RxDatabase.addCollections(): another instance created this collection with a different schema. Read this https://rxdb.info/questions-answers.html?console=qa#cant-change-the-schemaCode: DB8
CreateRxDatabase(): A RxDatabase with the same name and adapter already exists. Make sure to use this combination only once or set ignoreDuplicate to true if you do this intentional- This often happens in react projects with hot reload that reloads the code without reloading the process.Code: DB9
IgnoreDuplicate is only allowed in dev-mode and must never be used in productionCode: DB11
CreateRxDatabase(): Invalid db-name, folder-paths must not have an ending slashCode: DB12
RxDatabase.addCollections(): could not write to internal storeCode: DB13
CreateRxDatabase(): Invalid db-name or collection name, name contains the dollar signCode: DB14
No custom reactivity factory added on database creationCode: COL1
RxDocument.insert() You cannot insert an existing documentCode: COL2
RxCollection.insert() fieldName ._id can only be used as primaryKeyCode: COL3
RxCollection.upsert() does not work without primaryCode: COL4
RxCollection.incrementalUpsert() does not work without primaryCode: COL5
RxCollection.find() if you want to search by _id, use .findOne(_id)Code: COL6
RxCollection.findOne() needs a queryObject or string. Notice that in RxDB, primary keys must be strings and cannot be numbers.Code: COL7
Hook must be a functionCode: COL8
Hooks-when not knownCode: COL9
RxCollection.addHook() hook-name not knownCode: COL10
RxCollection .postCreate-hooks cannot be asyncCode: COL11
MigrationStrategies must be an objectCode: COL12
A migrationStrategy is missing or too muchCode: COL13
MigrationStrategy must be a functionCode: COL14
Given static method-name is not a stringCode: COL15
Static method-names cannot start with underscore _Code: COL16
Given static method is not a functionCode: COL17
RxCollection.ORM: statics-name not allowedCode: COL18
Collection-method not allowed because fieldname is in the schemaCode: COL20
Storage write errorCode: COL21
The RxCollection is closed or removed already, either from this JavaScript realm or from another, like a browser tabCode: CONFLICT
Document update conflict. When changing a document you must work on the previous revisionCode: COL22
.bulkInsert() and .bulkUpsert() cannot be run with multiple documents that have the same primary keyCode: COL23
In the open-source version of RxDB, the amount of collections that can exist in parallel is limited to 16. If you already purchased the premium access, you can remove this limit: https://rxdb.info/rx-collection.html#faqCode: DOC1
RxDocument.get$ cannot get observable of in-array fields because order cannot be guessedCode: DOC2
Cannot observe primary pathCode: DOC3
Final fields cannot be observedCode: DOC4
RxDocument.get$ cannot observe a non-existed fieldCode: DOC5
RxDocument.populate() cannot populate a non-existed fieldCode: DOC6
RxDocument.populate() cannot populate because path has no refCode: DOC7
RxDocument.populate() ref-collection not in databaseCode: DOC8
RxDocument.set(): primary-key cannot be modifiedCode: DOC9
Final fields cannot be modifiedCode: DOC10
RxDocument.set(): cannot set childpath when rootPath not selectedCode: DOC11
RxDocument.save(): can't save deleted documentCode: DOC13
RxDocument.remove(): Document is already deletedCode: DOC14
RxDocument.close() does not existCode: DOC15
Query cannot be an arrayCode: DOC16
Since version 8.0.0 RxDocument.set() can only be called on temporary RxDocumentsCode: DOC17
Since version 8.0.0 RxDocument.save() can only be called on non-temporary documentsCode: DOC18
Document property for composed primary key is missingCode: DOC19
Value of primary key(s) cannot be changedCode: DOC20
PrimaryKey missingCode: DOC21
PrimaryKey must be equal to PrimaryKey.trim(). It cannot start or end with a whitespaceCode: DOC22
PrimaryKey must not contain a linebreakCode: DOC23
PrimaryKey must not contain a double-quote ["]Code: DOC24
Given document data could not be structured cloned. This happens if you pass non-plain-json data into it, like a Date() object or a Function. In vue.js this happens if you use ref() on the document data which transforms it into a Proxy object.Code: DM1
Migrate() Migration has already runCode: DM2
Migration of document failed final document does not match final schemaCode: DM3
Migration already runningCode: DM4
Migration erroredCode: DM5
Cannot open database state with newer RxDB version. You have to migrate your database state first. See https://rxdb.info/migration-storage.html?console=storageCode: AT1
To use attachments, please define this in your schemaCode: EN1
Password is not validCode: EN2
ValidatePassword: min-length of password not compliedCode: EN3
Schema contains encrypted properties but no password is givenCode: EN4
Password not validCode: JD1
You must create the collections before you can import their dataCode: JD2
RxCollection.importJSON(): the imported json relies on a different schemaCode: JD3
RxCollection.importJSON(): json.passwordHash does not match the ownCode: LD1
RxDocument.allAttachments$ can't use attachments on local documentsCode: LD2
RxDocument.get(): objPath must be a stringCode: LD3
RxDocument.get$ cannot get observable of in-array fields because order cannot be guessedCode: LD4
Cannot observe primary pathCode: LD5
RxDocument.set() id cannot be modifiedCode: LD6
LocalDocument: Function is not usable on local documentsCode: LD7
Local document already existsCode: LD8
LocalDocuments not activated. Set localDocuments=true on creation, when you want to store local documents on the RxDatabase or RxCollection.Code: RC1
Replication: already addedCode: RC2
ReplicateCouchDB() query must be from the same RxCollectionCode: RC4
RxCouchDBReplicationState.awaitInitialReplication() cannot await initial replication when live: trueCode: RC5
RxCouchDBReplicationState.awaitInitialReplication() cannot await initial replication if multiInstance because the replication might run on another instanceCode: RC6
SyncFirestore() serverTimestampField MUST NOT be part of the collections schema and MUST NOT be nested.Code: RC7
SimplePeer requires to have process.nextTick() polyfilled, see https://rxdb.info/replication-webrtc.html?console=webrtcCode: RC_PULL
RxReplication pull handler threw an error - see .errors for more detailsCode: RC_STREAM
RxReplication pull stream$ threw an error - see .errors for more detailsCode: RC_PUSH
RxReplication push handler threw an error - see .errors for more detailsCode: RC_PUSH_NO_AR
RxReplication push handler did not return an array with the conflictsCode: RC_WEBRTC_PEER
RxReplication WebRTC Peer has errorCode: RC_COUCHDB_1
ReplicateCouchDB() url must end with a slash like 'https://example.com/mydatabase/'Code: RC_COUCHDB_2
ReplicateCouchDB() did not get valid result with rows.Code: RC_OUTDATED
Outdated client, update required. Replication was canceledCode: RC_UNAUTHORIZED
Unauthorized client, update the replicationState.headers to set correct auth dataCode: RC_FORBIDDEN
Client behaves wrong so the replication was canceled. Mostly happens if the client tries to write data that it is not allowed toCode: SC1
Fieldnames do not match the regexCode: SC2
SchemaCheck: name 'item' reserved for array-fieldsCode: SC3
SchemaCheck: fieldname has a ref-array but items-type is not stringCode: SC4
SchemaCheck: fieldname has a ref but is not type string, [string,null] or array<string>Code: SC6
SchemaCheck: primary can only be defined at top-levelCode: SC7
SchemaCheck: default-values can only be defined at top-levelCode: SC8
SchemaCheck: first level-fields cannot start with underscore _Code: SC10
SchemaCheck: schema defines ._rev, this will be done automaticallyCode: SC11
SchemaCheck: schema needs a number >=0 as versionCode: SC13
SchemaCheck: primary is always index, do not declare it as indexCode: SC14
SchemaCheck: primary is always unique, do not declare it as indexCode: SC15
SchemaCheck: primary cannot be encryptedCode: SC16
SchemaCheck: primary must have type: stringCode: SC17
SchemaCheck: top-level fieldname is not allowedCode: SC18
SchemaCheck: indexes must be an arrayCode: SC19
SchemaCheck: indexes must contain strings or arrays of stringsCode: SC20
SchemaCheck: indexes.array must contain stringsCode: SC21
SchemaCheck: given index is not defined in schemaCode: SC22
SchemaCheck: given indexKey is not type:stringCode: SC23
SchemaCheck: fieldname is not allowedCode: SC24
SchemaCheck: required fields must be set via array. See https://spacetelescope.github.io/understanding-json-schema/reference/object.html#requiredCode: SC25
SchemaCheck: compoundIndexes needs to be specified in the indexes fieldCode: SC26
SchemaCheck: indexes needs to be specified at collection schema levelCode: SC28
SchemaCheck: encrypted fields is not defined in the schemaCode: SC29
SchemaCheck: missing object key 'properties'Code: SC30
SchemaCheck: primaryKey is requiredCode: SC32
SchemaCheck: primary field must have the type string/number/integerCode: SC33
SchemaCheck: used primary key is not a property in the schemaCode: SC34
Fields of type string that are used in an index, must have set the maxLength attribute in the schemaCode: SC35
Fields of type number/integer that are used in an index, must have set the multipleOf attribute in the schemaCode: SC36
A field of this type cannot be used as indexCode: SC37
Fields of type number that are used in an index, must have set the minimum and maximum attribute in the schemaCode: SC38
Fields of type boolean that are used in an index, must be required in the schemaCode: SC39
The primary key must have the maxLength attribute set. Ensure you use the dev-mode plugin when developing with RxDB.Code: SC40
$ref fields in the schema are not allowed. RxDB cannot resolve related schemas because it would have a negative performance impact.It would have to run http requests on runtime. $ref fields should be resolved during build time.Code: SC41
Minimum, maximum and maxLength values for indexes must be real numbers, not Infinity or -InfinityCode: DVM1
When dev-mode is enabled, your storage must use one of the schema validators at the top level. This is because most problems people have with RxDB is because they store data that is not valid to the schema which causes strange bugs and problems.Code: VD1
Sub-schema not found, does the schemaPath exists in your schema?Code: VD2
Object does not match schemaCode: S1
You cannot create collections after calling RxDatabase.server()Code: GQL1
GraphQL replication: cannot find sub schema by keyCode: GQL3
GraphQL replication: pull returns more documents then batchSizeCode: CRDT1
CRDT operations cannot be used because the crdt options are not set in the schema.Code: CRDT2
RxDocument.incrementalModify() cannot be used when CRDTs are activated.Code: CRDT3
To use CRDTs you MUST NOT set a conflictHandler because the default CRDT conflict handler must be usedCode: DXE1
Non-required index fields are not possible with the dexie.js RxStorage: https://github.com/pubkey/rxdb/pull/6643#issuecomment-2505310082Code: RM1
Cannot communicate with a remote that was build on a different RxDB version. Did you forget to rebuild your workers when updating RxDB?Code: SNH
This should never happen