electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
7.97k stars 150 forks source link

Weirdness in importing contrib extensions #188

Open kzlar opened 1 month ago

kzlar commented 1 month ago

Following up from discord: https://discord.com/channels/933657521581858818/1212676471588520006/1272947534960001054

In short: Using vscode, node and trying to import pg_tgrm, the following: import { pg_trgm } from '@electric-sql/pglite/contrib/pg_trgm' works but has a type issue in vscode Cannot find module '@electric-sql/pglite/contrib/pg_trgm' or its corresponding type declarations The following: import { pg_trgm } from '@electric-sql/pglite/dist/contrib/pg_trgm' does not have type issues but fails when running with node Missing "./dist/contrib/pg_trgm" specifier in "@electric-sql/pglite" package

I think the first option should work but some type export config is likely wrong?

summer-boythink commented 2 weeks ago

image

I use import { pg_trgm } from '@electric-sql/pglite/contrib/pg_trgm',Didn't seem to find a problem.

Can you give an example of a recurring bug