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
I'm working on a project with Authjs and I'm using Drizzle and SQLite with better-sqlite3 and when checking if the user is authenticated in the middleware with auth I'm getting this error:
Error: The edge runtime does not support Node.js 'fs' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
at (webpack-internal:///(middleware)/./node_modules/.pnpm/next@14.2.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/esm/server/web/globals.js:34)
at Object.get (webpack-internal:///(middleware)/./node_modules/.pnpm/next@14.2.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/esm/server/web/globals.js:34:19)
at promisify (node:internal/util:400:15)
at eval (webpack-internal:///(middleware)/./node_modules/.pnpm/better-sqlite3@11.3.0/node_modules/better-sqlite3/lib/methods/backup.js:6:18)
at (middleware)/./node_modules/.pnpm/better-sqlite3@11.3.0/node_modules/better-sqlite3/lib/methods/backup.js (file:///.next/server/src/middleware.js:135:1)
at webpack_require (file:///.next/server/edge-runtime-webpack.js:37:33)
at fn (file:///.next/server/edge-runtime-webpack.js:285:21)
at eval (webpack-internal:///(middleware)/./node_modules/.pnpm/better-sqlite3@11.3.0/node_modules/better-sqlite3/lib/database.js:79:29)
at (middleware)/./node_modules/.pnpm/better-sqlite3@11.3.0/node_modules/better-sqlite3/lib/database.js (file:///.next/server/src/middleware.js:102:1)
at webpack_require (file:///.next/server/edge-runtime-webpack.js:37:33)
at fn (file:///.next/server/edge-runtime-webpack.js:285:21)
If I remove auth from the middleware then the error goes away.
How to reproduce
pnpm install && pnpm dev
Expected behavior
I would expect to be able to check if the user is authenticated or not in the middleware.
The text was updated successfully, but these errors were encountered:
alveshelio
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Sep 17, 2024
Environment
Reproduction URL
https://github.com/parite-sciences/webapp-resources
Describe the issue
I'm working on a project with Authjs and I'm using Drizzle and SQLite with better-sqlite3 and when checking if the user is authenticated in the middleware with
auth
I'm getting this error:If I remove
auth
from the middleware then the error goes away.How to reproduce
pnpm install && pnpm dev
Expected behavior
I would expect to be able to check if the user is authenticated or not in the middleware.
The text was updated successfully, but these errors were encountered: