Skip to content
Back

rxdb integration code not working

  • 0
  • Web
Rockyfelle
26 Dec, 2025, 21:46

https://appwrite.io/blog/post/offline-first-journal This code does not work with rxdb and appwrite packages set to february releases nor newest releases

TL;DR
Developers are struggling to get the replication code working with rxdb integration due to changes in Appwrite's API. The error points to 'replicationState is not defined' and 'TypeError: Cannot read properties of undefined'. The issue seems to be with the compatibility between the blog's code and the current versions of "appwrite" and "rxdb". Upgrading packages to the latest versions doesn't solve the issue. The official documentation's code is outdated, leading to confusion. A solution might involve modifying the replication setup or making necessary adjustments for compatibility with the updated versions.
Kenny
26 Dec, 2025, 21:47

Can you let me know what version of appwrite and rxdb you're using

Rockyfelle
26 Dec, 2025, 21:47

"appwrite": "^17.0.2", "rxdb": "^16.8.1", releases approx when blog was posted OR "appwrite": "^21.5.0", "rxdb": "^16.21.1", newest releases

Both of these lead to the same error

TypeScript
    at getJournals (databases.js:119:20)
    at async load (App.jsx:16:16)
load @ App.jsx:18
await in load
(anonymous) @ App.jsx:26
react_stack_bottom_frame @ react-dom_client.js?v=69f92d96:18821
runWithFiberInDEV @ react-dom_client.js?v=69f92d96:1251
commitHookEffectListMount @ react-dom_client.js?v=69f92d96:9665
commitHookPassiveMountEffects @ react-dom_client.js?v=69f92d96:9719
reconnectPassiveEffects @ react-dom_client.js?v=69f92d96:11527
recursivelyTraverseReconnectPassiveEffects @ react-dom_client.js?v=69f92d96:11494
reconnectPassiveEffects @ react-dom_client.js?v=69f92d96:11571
doubleInvokeEffectsOnFiber @ react-dom_client.js?v=69f92d96:13593
runWithFiberInDEV @ react-dom_client.js?v=69f92d96:1251
recursivelyTraverseAndDoubleInvokeEffectsInDEV @ react-dom_client.js?v=69f92d96:13566
commitDoubleInvokeEffectsInDEV @ react-dom_client.js?v=69f92d96:13601
flushPassiveEffects @ react-dom_client.js?v=69f92d96:13411
(anonymous) @ react-dom_client.js?v=69f92d96:13030
performWorkUntilDeadline @ react-dom_client.js?v=69f92d96:33
<App>
exports.createElement @ chunk-WUR7D6NS.js?v=d26fadd3:793
(anonymous) @ main.jsx:8Understand this error
databases.js:113 Replication setup error: ReferenceError: replicationState is not defined
    at setupReplication (databases.js:88:20)
    at getDB (databases.js:76:3)
    at async getJournals (databases.js:118:13)
    at async load (App.jsx:16:16)```
Rockyfelle
26 Dec, 2025, 21:49

and realtime need to be commented out or be given extra variables for the code not to break before that, official code seems outdated on that front

Kenny
26 Dec, 2025, 21:51

Can you paste your databases.js file?

Kenny
26 Dec, 2025, 21:52

I agree, even in the rxdb docs it's wrong.

https://rxdb.info/replication-appwrite.html

Rockyfelle
26 Dec, 2025, 21:56

literally copied from the blog

Rockyfelle
26 Dec, 2025, 21:56

thanks discord thats beautiful formatting

Kenny
26 Dec, 2025, 21:57

ah alright, wasn't sure if you used that to make your own

Rockyfelle
26 Dec, 2025, 21:59

The plan is to make it dynamic so I can use it to retrieve/post from any table but I guess something changed on appwrite's api so it just doesnt function at all

Rockyfelle
26 Dec, 2025, 22:00

(cause im too dumb to make my own from scratch according to the docs, though the blame there might more be on me and rxdb than appwrite)

Kenny
26 Dec, 2025, 22:00

oh, in setupReplication does replicationState have it's initializer somewhere?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more