Deprecation warning (promisify) when upgrading to Node v21.6.0
Checklist
- [X] The issue can be reproduced in the express-openid-connect sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Description
Hello 👋
We recently upgraded our Node service to v21.6.0 and we start to see some deprecation warning:
[DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
With --trace-deprecation argument, we can see those warnings come from the lib:
(node:45354) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
at node:internal/util:431:17
at new Promise (<anonymous>)
at RedisStore.get (node:internal/util:416:12)
at CustomStore.get (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected][email protected]/node_modules/express-openid-connect/lib/appSession.js:203:19)
at /REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected][email protected]/node_modules/express-openid-connect/lib/appSession.js:325:46
at /REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/dd-trace/packages/datadog-instrumentations/src/router.js:22:57
at /REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:26:21
at Layer.handle [as handle_request] (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:328:13)
at /REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:346:12)
at Function.process_params (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/dd-trace/packages/datadog-instrumentations/src/express.js:70:23)
at next (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:175:3)
at router (/REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:47:12)
at /REDACTED/REDACTED/REDACTED/REDACTED/apps/api-server/dist/main.js:587:14
This comes from this code https://github.com/auth0/express-openid-connect/blob/8ade66846a1f041591e267d2296b02df2604f1f4/lib/appSession.js#L190
Reproduction
Tested in the express-opend-id-connect sample app:
const dotenv = require("dotenv");
const express = require("express");
const http = require("http");
const logger = require("morgan");
const path = require("path");
const router = require("./routes/index");
const { auth } = require("express-openid-connect");
// Redis store
const { createClient } = require("redis");
const RedisStore = require("connect-redis").default;
let redisClient = createClient();
redisClient.connect().catch(console.error);
dotenv.load();
const app = express();
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "ejs");
app.use(logger("dev"));
app.use(express.static(path.join(__dirname, "public")));
app.use(express.json());
const config = {
authRequired: false,
auth0Logout: true,
session: {
store: new RedisStore({ client: redisClient }),
},
};
(...)
Additional context
No response
express-openid-connect version
2.17.1
Express version
4.18.2
Node.js version
21.6.0
Is this package maintained?
Hey @chrisvander and @Will956 , Apologies for the delay in addressing this issue. We’re prioritising it now and will work on getting it fixed as soon as possible. I’ll keep you updated with any progress along the way. Thanks for your patience!
Hello @gyaneshgouraw-okta, do you have any updates on this? Thanks!
Hello @gyaneshgouraw-okta any updates on this issue? Thank you very much for your response in advance.
Hi, @Will956, what is the 'connect-redis' version you are using?
"connect-redis": "8.1.0", this one
When we encountered this issue, it was "connect-redis": "7.1.0", - maybe that's what you're are looking for
Hi, @Will956
When we encountered this issue, it was "connect-redis": "7.1.0"
Are you still getting the issue with"connect-redis": "8.1.0" or the one you are currently using?
Yes, still happens
Hi, @Will956
The fix for this issue is now available in version v2.19.2.
Thank you for your patience! This issue has been resolved. Feel free to reopen it if you encounter any further problems.
@kushalshit27 After upgrading to the latest version, we’re encountering a TypeError: callback is not a function when reading the current session using [email protected] as the session store:
'TypeError: callback is not a function at MSSQLStore.get (***/node_modules/connect-mssql-v2/dist/src/store.js:196:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async ***/node_modules/express-openid-connect/lib/appSession.js:327:29'
It seems that express-openid-connect is calling store.get() without a callback as second arg, but connect-mssql-v2 requires it.
Hi, @redoper1 ,
We have released a patch version; please use v2.19.2. I would appreciate it if you tested this out, and if the problem persists, we can re-evaluate.
Thanks
Hi, @kushalshit27,
after initial testing it looks good to me. We will try to use it more in the coming days and report any other potential problems.
Thank you very much for quick fix.