NPM package "pg@8.16.0" does not define an export ".".
Hello everyone!
I'm relatively new to the deno world and am currently trying to create a simple CRUD API with Fresh.
I followed this article: https://deno.com/blog/build-database-app-drizzle and installed pg with
deno install npm:pg
. However when trying to import it in any form from
my VSCode prints out an error saying NPM package "pg@8.16.0" does not define an export ".".
Does anyone know how to fix this or work around this?Deno
Build a Database App with Drizzle ORM and Deno | Deno
Using an object-relational mapping (ORM) database can make working with persistent data simpler. Here's how to use a popular ORM, Drizzle, with Deno.
16 Replies
This works
Sadly same issue
So basically it is working, however, VSCode somehow has an issue with the import itself
Have you tried restarting the deno lsp since adding the imports?
can you also post your deno.json imports section?
I did restart VSCode multiple times. Not sure if that also restarts the lsp
I'd imagine restarting vscode does restart the lsp but just in case let's try. You can use
cmd+shift+p
to bring up vscode commands. If you're on windows it's ctrl+shift+p
I believe. Then type in Deno restart and it show show an option to restart to lspThis fixes it though:
what version of deno are you using?
deno 2.3.1
upgrading to 2.3.3 got the same issue
strange, yeah your vscode just isnt recognizing the types for some reason. Not sure what would cause that
Ah I think I see the potential error
whatcha got?
version mismatch maybe?
shouldn't be. I'm using the same locally and have no issue
it's resolving 8.16 for pg and 8.15.2 for types
and @types/pg is actually the latest
exactly
ah ok, changing that kind of brought the error back 😂
lol
crazy question. Your deno vs code extension is up to date as well?
let me check
... however, manually restarting deno language server seems to be working
I'll check the vs code extension and also restart vscode itself
Deno 3.44.2
seems to be up to date
I think manually restarting the LSP did the trick
Thanks for your help guys 🙂