porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.09k stars 259 forks source link

Module not found: Can't resolve 'net' #776

Open Gibril1 opened 6 months ago

Gibril1 commented 6 months ago

This is the error i get when i want to view pages in nextjs. How can i solve this

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module: ./node_modules/postgres/src/index.js ./constants.ts ./utils/authenticateUser.ts ./app/login/page.tsx

Louis-Tian commented 6 months ago

"net" is a node js standard library. I think you are trying to run this on the browser since you are referencing nextjs. This library does not work on browser. Unless you are trying to run this library with server side rendering with nextjs then you should go ask on nextjs repo.