Skip to content

[Question] using with expo on the web #429

Description

@Mael-Abgrall

Hello

I'm trying out op-sqlite as a durable storage on my app. The app is made with Expo, I don't use any of the conflicting packages (expo-update and such).

On mobile, so far no issue, it works.

However, for the web, I'm scratching my head, I get this obscure error: Cannot read properties of undefined (reading 'getConstants') from the line import { open, openAsync } from '@op-engineering/op-sqlite';

The call is made from the main thread in a wrapper:

export async function openDatabase(): Promise<void> {
  if (Platform.OS === 'web') {
    sqliteClient = await openAsync({
      name: 'app.db',
    });
  } else {
    sqliteClient = open({
      name: 'app.db',
    });
  }
}

my config is:

 "op-sqlite": {
    "sqlcipher": false,
    "performanceMode": true,
    "fts5": true
  },
"@op-engineering/op-sqlite": "^17.1.2",
"@sqlite.org/sqlite-wasm": "^3.53.0-build1",

I would appreciate a bit of help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions