{"record":{"id":"87f330c6e6f70d15","repo":"pubkey/rxdb","slug":"doc3","errorCode":"DOC3","errorMessage":"RxDB Error-Code: DOC3. 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: DOC3\\. 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-document.ts","lineNumber":150,"sourceCode":"\n    /**\n     * returns observable of the value of the given path\n     */\n    get$(this: RxDocument, path: string): Observable<any> {\n        if (overwritable.isDevMode()) {\n            if (path.includes('.item.')) {\n                throw newRxError('DOC1', {\n                    path\n                });\n            }\n\n            if (path === this.primaryPath) {\n                throw newRxError('DOC2');\n            }\n\n            // final fields cannot be modified and so also not observed\n            if (this.collection.schema.finalFields.includes(path)) {\n                throw newRxError('DOC3', {\n                    path\n                });\n            }\n\n            const schemaObj = getSchemaByObjectPath(\n                this.collection.schema.jsonSchema,\n                path\n            );\n\n            if (!schemaObj) {\n                throw newRxError('DOC4', {\n                    path\n                });\n            }\n        }\n\n        return this.$\n            .pipe(","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-document.ts#L132-L168","documentation":"DOC3 is thrown when you try to observe a final (read-only) schema field via RxDocument.get$(path). Final fields cannot be modified, so their value can never change and an observable would never emit anything new; RxDB rejects the call to surface the mistake. This check only runs in dev mode.","triggerScenarios":"Calling doc.get$() on a field defined with final: true in the RxJsonSchema, e.g. a createdAt timestamp, while the dev-mode plugin is active.","commonSituations":"Observing schema-internal fields like createdAt/updatedAt marked final; generic observation helpers that walk all schema properties including final ones; migrating schemas where a field newly became final.","solutions":["Read the final field statically: const createdAt = doc.get('createdAt').","Exclude final fields (this.collection.schema.finalFields) from any dynamic observation logic.","If the value must change, remove final: true from the schema (requires a schema/migration rethink, not a code-only fix)."],"exampleFix":"// before\ndoc.get$('createdAt').subscribe(v => ...);\n// after\nconst createdAt = doc.get('createdAt'); // final fields never change, no observation needed","handlingStrategy":"validation","validationCode":"function assertNotFinal(doc, path) {\n  if (doc.collection.schema.finalFields.includes(path)) {\n    throw new Error('Final field cannot be observed, read statically: ' + path);\n  }\n}","typeGuard":"function isMutableField(doc, path) {\n  return !doc.collection.schema.finalFields.includes(path);\n}","tryCatchPattern":"try {\n  obs = doc.get$(path);\n} catch (err) {\n  if (String(err?.code) === 'DOC3') {\n    // final fields never change: emit the static value once\n    import('rxjs').then(({ of }) => obs = of(doc.get(path)));\n  } else {\n    throw err;\n  }\n}","preventionTips":["Filter doc.collection.schema.finalFields out of dynamic observation paths.","Read final fields (createdAt etc.) statically once.","Only mark fields final: true when their value genuinely never changes.","Keep the dev-mode plugin enabled while developing to catch this early."],"tags":["rxdocument","observable","schema","final-fields","dev-mode"],"backgroundTag":"unsupported-observable-path","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}