Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: Unable to import sequelize/postgres #1885

Open
6 tasks done
steelbrain opened this issue Feb 7, 2025 · 0 comments
Open
6 tasks done

v4: Unable to import sequelize/postgres #1885

steelbrain opened this issue Feb 7, 2025 · 0 comments
Labels

Comments

@steelbrain
Copy link

Checklist

Description

I'm on v4.0.0-beta.14 and stuck. For my usecase, I need access to the database in beforeSessionSaved so I can save a userId along with some other parameters in the session context.

In v4, the callback runs in the Next.js edge runtime, which is quite a bit limited compared to the regular runtime. I am unable to use my sequelize postgres setup, here's the stack trace

upport Node.js 'tty' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
    at <unknown> (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:43)
    at Object.apply (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:43:19)
    at eval (webpack-internal:///(middleware)/./node_modules/colorette/index.cjs:39:61)
    at (middleware)/./node_modules/colorette/index.cjs (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/src/middleware.js:31226:1)
    at __webpack_require__ (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/edge-runtime-webpack.js:37:33)
    at fn (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/edge-runtime-webpack.js:315:21)
    at eval (webpack-internal:///(middleware)/./node_modules/pino-pretty/index.js:3:30)
    at (middleware)/./node_modules/pino-pretty/index.js (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/src/middleware.js:31248:1)
    at __webpack_require__ (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/edge-runtime-webpack.js:37:33)
    at fn (file:///Users/aneesiqbal/Projects/shw/app/projects/webapp/.next/server/edge-runtime-webpack.js:315:21)
    at eval (webpack-internal:///(middleware)/./src/server/utils/base-logger.ts:8:69)
 ⚠ ./node_modules/sequelize/lib/dialects/abstract/connection-manager.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/sequelize/lib/dialects/abstract/connection-manager.js
./node_modules/sequelize/lib/dialects/sqlite/connection-manager.js
./node_modules/sequelize/lib/dialects/sqlite/index.js
./node_modules/sequelize/lib/sequelize.js
./node_modules/sequelize/lib/index.js
./node_modules/sequelize/lib/index.mjs
./src/server/services/auth/authClient.ts

Reproduction

Not relevant given that this is a pretty well known limitation of the edge runtime

Additional context

No response

nextjs-auth0 version

4.0.0-beta.14

Next.js version

14.2.21

Node.js version

v22.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants