You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing @vercel/postgres from a CommonJS module with "moduleResolution": "Node16" TypeScript resolves the ES module type declaration so it thinks it is importing an ES module. The result is a compilation error telling you to use a dynamic import.
When importing
@vercel/postgres
from a CommonJS module with"moduleResolution": "Node16"
TypeScript resolves the ES module type declaration so it thinks it is importing an ES module. The result is a compilation error telling you to use a dynamic import.A better explanation can be found here.
I found this when I tried to use
@vercel/postgres
but I'm pretty sure this happens in all packages in this repo.I think the solution would be to remove the
"types"
field in package.json and let TypeScript infer the right file based on the name.The text was updated successfully, but these errors were encountered: