Skip to content
Discussion options

You must be logged in to vote

sorry, I made a mistake. The new version of pglite requires importing more wasm, it can work properly now.

import { PGlite, type PGliteOptions } from '@electric-sql/pglite'

// @ts-ignore
import wasmPath from 'node_modules/@electric-sql/pglite/dist/pglite.wasm' with {
  type: 'file',
  embed: 'true',
}

// @ts-ignore
import initdbWasmPath from 'node_modules/@electric-sql/pglite/dist/initdb.wasm' with {
  type: 'file',
  embed: 'true',
}

// @ts-ignore
import dataPath from 'node_modules/@electric-sql/pglite/dist/pglite.data' with {
  type: 'file',
  embed: 'true',
}

export async function createPGlite(dataDir: string, options?: PGliteOptions): Promise<PGlite> {
  // Read the embedded files
  

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@seepine
Comment options

Answer selected by seepine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants