Expo error: `FunctionCallException: Calling the 'createChangesetSync`
Here is a repro repo: https://github.com/LydiaF/livestore-app
This is what I changed:
boot={(store) => {
// if (store.query(tables.todos.count()) === 0) {
store.commit(events.todoCreated({ id: "1", text: 'Make coffee' }))
// }
}}
'v1.TodoCreated': ({ id, text }, ctx) => {
const exists = ctx.query(tables.todos.where({ id }))
if (exists.length > 0) {
return []
}
return tables.todos.insert({ id, text, completed: false })
},
and I am getting this error on the second time and every time after the app loads...
ERROR [Error: FunctionCallException: Calling the 'createChangesetSync' function has failed (at ExpoModulesCore/SyncFunctionDefinition.swift:137)
→ Caused by: SQLiteErrorException: Error code 0: not an error (at ExpoSQLite/SQLiteModule.swift:740)]
ERROR [Error: FunctionCallException: Calling the 'createChangesetSync' function has failed (at ExpoModulesCore/SyncFunctionDefinition.swift:137)
→ Caused by: SQLiteErrorException: Error code 0: not an error (at ExpoSQLite/SQLiteModule.swift:740)]
ERROR Warning: LiveStore.UnexpectedError: { "cause": UnknownException: An unknown error occurred in Effect.try, "note": undefined, "payload": undefined }
42 | boot={(store) => {
43 | // if (store.query(tables.todos.count()) === 0) {
> 44 | store.commit(events.todoCreated({ id: "1", text: 'Make coffee' }))
| ^
45 | // }
46 | }}
47 | batchUpdates={batchUpdates}
Call Stack
LiveStoreProvider.props.boot (src/Root.tsx:44:23)
Thank you very much for looking into this :)
the root cause is actually coming from expo-sqlite and i have a solution pr at https://github.com/expo/expo/pull/37246. thanks for sharing the issue
Closing as this has been fixed upstream in Expo. Will probably take a few days before this is available in Expo Go as well.
Okay, great, thanks! I didn't figure out how to try the pr so I will just wait for the release :)
i published [email protected] for the fix. please try to use npx expo run:[android|ios] or eas build instead of expo-go. because expo-go need to waits for more fixes and sends app store review in batch
Woo, working perfectly! Thank you so much @Kudo :)