koa-session2
koa-session2 copied to clipboard
TypeError: store.getID is not a function
In version 2.2.10, there is an error.
In index.js there is a call with:
id = await store.getID(24);
But in store.js the function getID is not a promise:
getID(length) {
Result is:
TypeError: store.getID is not a function
at /opt/aplus/dev/server/node_modules/koa-session2/index.js:17:34
@RobertPrediger what version of node do you use? I think the await keyword is compatible with the synchronization function.
@Secbone I am using 14.15.4
As a workaround, if I remove the await, it's working.
@RobertPrediger Do you use a custom store object? I think if it is an async function problem, it will be failed at this line
https://github.com/Secbone/koa-session2/blob/9ee7b2696f4f77bbaa354e3201952f754e98196e/index.js#L12-L14
before the getID function. 🤔