I'm getting this error This expression is not constructable. Each member of the union type 'typeof PowerSyncDatabase | typeof PowerSyncDatabase' has construct signatures, but none of those signatures are compatible with each other.ts(2351) when calling the constructor new PowerSyncDatabase(...)
Why PowerSyncDatabase of web and React Native have different constructors?
The problem was the outdated @powersync/common. Solve updating it "@powersync/common": "^1.16.2" making it the compatible with web and react native dependencies.
PROBLEM
I'm getting this error
This expression is not constructable. Each member of the union type 'typeof PowerSyncDatabase | typeof PowerSyncDatabase' has construct signatures, but none of those signatures are compatible with each other.ts(2351)
when calling the constructornew PowerSyncDatabase(...)
Why
PowerSyncDatabase
of web and React Native have different constructors?CONTEXT
Versions: @powersync/react-native v1.12.0, @powersync/web v1.6.0
I'm conditionally importing web or react native, below is the code.
// repositories/sqlite/src/powersync_db.ts
// repositories/sqlite/src/powersync_client.ts