Skip to content

Improve the error message when trying to use OPFS outside of a worker #201

Description

@TheAndrewJackson

Description

I'm running into an issue when trying to create a new database using the OPFS AHP file system. This snippet

import { PGlite } from "@electric-sql/pglite";

const client = await PGlite.create({
  dataDir: "opfs-ahp://electric.db",
  relaxedDurability: true,
});

is producing this error

image

I have a minimal-repro repo here that has the issue: https://github.com/TheAndrewJackson/opfs-ahp_bug_repro

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