paragi / express-session-rsdb

Rocket-Store session storage for express
MIT License
4 stars 1 forks source link

Does not support rocket-store > 0.10.8 #9

Open Nidroide opened 9 months ago

Nidroide commented 9 months ago

Hi Simon,

express-session-rsdb has a dependency constraint of >0.10.4 for rocket-store. It works fine up to version 0.10.8. However, when using version 0.10.12, I encounter the following error:

node:internal/modules/cjs/loader:573
      throw e;
      ^
Error: Cannot find module '.../node_modules/rocket-store/dist/cjs/index.js'

For versions 0.10.14 and above, I encounter a different issue:

...node_modules/express-session-rsdb/index.js:29
    rsdb.options(options);
         ^
TypeError: rsdb.options is not a function

This is likely due to changes in the way rocket-store exports its functions and should be fixed, as alternative dependency should be fixed to 0.10.8.

For a quick temporary fix:

"overrides": {
      "rocket-store" : "0.10.8"
  }

in consumer project package.json.

Regards

wherreral commented 4 months ago

Hi! I hope you guys are doing great!

I'm facing this same issue but I don't understand where to insert the solution. I put the overwrite in my project package.json but nothing happend.

Any help is appreciated.

giichi0216 commented 2 weeks ago

Just add ".default" to the index.js file ..

this is the original code

const rsdb = require("rocket-store");
const session = require('express-session');
const util = require('util');

and this is the code to support the current version (as of now rocket-store@0.10.19)

const rsdb = require("rocket-store").default;
const session = require('express-session');
const util = require('util');
paragi commented 2 weeks ago

Is this resolved? Please either merge a pull request or close.

giichi0216 commented 2 weeks ago

Pull request has already been created