konkorokke
CDCloudflare Developers
•Created by konkorokke on 5/8/2024 in #pages-help
next-on-pages with pg fails with Module not found: Can't. resolve 'fs'
Hi.
I'm struggling to make it work with next-on-pages, pg, Auth.js with next dev with export const runtime = "edge"; enabled.
It gives me following error, but I thought it should work and does not use any edge-uncompatible modules such as fs because of pg-cloudflare.
I did set Auth.js strategy to use jwt and separate middleware from auth.ts following https://authjs.dev/getting-started/migrating-to-v5#edge-compatibility .
Does anyone know how to make it work? Thanks.
⨯ ./node_modules/pg-connection-string/index.js:76:69
Module not found: Can't resolve 'fs'
Import trace for requested module:
./node_modules/pg/lib/connection-parameters.js
./node_modules/pg/lib/client.js
./node_modules/pg/lib/index.js
./src/auth.ts
./src/app/page.tsx
1 replies