-
Notifications
You must be signed in to change notification settings - Fork 345
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
TypeError: RedisStore is not a constructor #418
Comments
I am running Node 23 currently without issues. Do you have a small project that duplicates this issue?
We ran into compatibility issues between CommonJS and ESM projects, this makes one common API. (see #411) |
Not sure what's going on there. That second screenshot you shared looks incorrect. It almost looks like you maybe installed the |
Thank you very much I would attempt to delete the @types/connect-redis module and attempt it again oh and Happy new year from Nigeria. |
If try it:
|
Are you installing the "@types/connect-redis" dependency ? |
I am facing the exact same issue. I am on node 23.5 Section of my code
error
|
That's an issue on Node.js 22 and lower. |
I am on nodejs 23.5 |
Same problem with Node.js v22.13.0 also. Only if we initialize "const { RedisStore } = require("connect-redis");" the error is not occurring. Node.js v22.13.0 |
There is no default export anymore in Redis v8. See v8 release migration notes and latest readme: For CommonJS-style imports it should look like:
|
Hi everyone,
In one of my projects, a strange TypeError appear when I switch from Node.js v20.15.0 to Node.js v22.12.0 .
When I try to create a new RedisStore instance this type error occurs :
I find that the error can be solved using
const { RedisStore } = require("connect-redis");
in the project with Node.js v22.12.0 with connect-redis version ^8.0.1.Previously I used
const RedisStore = require("connect-redis").default;
in the project with Node.js v20.15.0 with connect-redis version ^7.1.1Is there some reason why I cannot use the the same line of code in both version ?
The text was updated successfully, but these errors were encountered: