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

Deprecation warning (promisify) when upgrading to Node v21.6.0 #571

Open
6 tasks done
Will956 opened this issue Jan 17, 2024 · 0 comments
Open
6 tasks done

Deprecation warning (promisify) when upgrading to Node v21.6.0 #571

Will956 opened this issue Jan 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Will956
Copy link
Contributor

Will956 commented Jan 17, 2024

Checklist

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

this._get = promisify(store.get).bind(store);

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 }),
  },
};

(...)
Capture d’écran 2024-01-17 à 21 36 43

Additional context

No response

express-openid-connect version

2.17.1

Express version

4.18.2

Node.js version

21.6.0

@Will956 Will956 added the bug Something isn't working label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant