Typescript express-jwt - This expression is not callable Error

Defining the constant

Blockquote
export const checkJwt = jwt({
secret: jwksRsa.expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: https://${process.env.AUTH0_DOMAIN}/.well-known/jwks.json
}),

// Validate the audience and the issuer.
audience: process.env.AUTH0_AUDIENCE,
issuer: https://${process.env.AUTH0_DOMAIN}/,
algorithms: [“RS256”]
});
Throws an exception stating that jwt() This expression is not callable. and node_modules/express-jwt/dist/index"’ has no call signatures.ts(2349)

How do you resolve this issue?

1 Like

They updated both libraries you use.
Now import like that:
import {expressjwt} from ‘express-jwt’;
import { expressJwtSecret } from ‘jwks-rsa’;

and cast “as GetVerificationKey;” to the “expressJwtSecret”