'express-jwt got TypeError: express_jwt__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function

The following code works fine for [email protected], but got TypeError for [email protected]

import expressJwt from 'express-jwt'

const requireSignin = expressJwt({ 
secret: config.jwtSecret, 
userProperty: 'auth',
algorithms: ["HS256"]
})

I am just start learning MERN, just don't know how to adapt this code to the latest express-jwt



Solution 1:[1]

Sorry, just found the return type changed

Solution 2:[2]

Relates to another post

Just need to tweak the way you import from

import expressJwt from 'express-jwt'

to the following as per official documentation

import { expressjwt } from "express-jwt"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 natu
Solution 2