Express.js和connect-mongo-session"TypeError:无法读取属性'混
Express.js and connect-mongo session "TypeError: Cannot read property 'upserted' of undefined"
我正试图使用connect-mongo模块存储会话,但我收到以下错误:
TypeError: Cannot read property 'upserted' of undefined
connect-mongo
的用法如下:
import session from 'express-session';
const MongoStore = require('connect-mongo')(session);
app.use(session({
secret: 'SECRET',
store: new MongoStore({ url: 'mongodb://mongo:27017/sessions' }),
saveUninitialized: true,
resave: false
}));
同时,我可以看到每个页面上都创建了会话条目,并重新加载了以下内容:
{
"_id": "zO68C8OuARTUblw3EqHfUikR_IIHRaQq",
"session": "{'"cookie'": '"originalMaxAge'":null,'"expires'":null,'"httpOnly'":true,'"path'":'"/'" }}",
"expires": new Date(1470779765287)
}
并且从创建时间戳(默认值)起,过期日期设置为14天
使用的软件包版本:
"cookie-parser": "^1.4.3",
"connect-mongo": "^1.3.1",
"express": "~4.0.0",
"express-session": "^1.14.0",
我在connect mongo存储库上打开了一个问题,事实上,这个问题已经在最新版本1.3.2中得到了解决:)
相关文章:
- TypeError:无法读取属性'推'未定义的JavaScript
- 同样,同样的错误'ahorcado.js:26未捕获类型错误:无法读取属性'beginPath'
- 未捕获的类型错误:无法读取属性'删除'的未定义
- AngularJS指令出错-无法读取属性'编译'的未定义
- 未捕获的类型错误:无法读取属性'name'即使它存在,也无法定义
- 看到“;未捕获的类型错误:无法读取属性'weight'未定义的“;尽管按照字面上的指示
- 无法读取属性'材料'未定义的Three.js
- 得到"TypeError:无法读取属性'filename'未定义的“;调用“npm start
- Soundcloud api"未捕获的类型错误:无法读取属性'uri'“未定义”;
- 未捕获的类型错误:无法读取属性'addEventListener'的null chrome扩展名
- Soundcloud Javascript SDK 3.0-回调无法读取属性'connectCallback
- 未捕获的类型错误:无法读取属性'状态'在react中为null
- JavaScript承诺-无法读取属性'那么'的未定义
- Javascript Float32数组抛出无法读取属性'0'即使数组定义良好,也为null
- 未捕获的类型错误:无法读取属性'中止'的未定义
- 角度推入数组给出:TypeError:无法读取属性'推'的未定义
- http/rxjs catch回调中的Angular 2重定向导致TypeError:无法读取属性'订阅'
- Javascript未捕获类型错误:无法读取属性'0'的未定义
- jQuery控制台错误:无法读取属性'top'的未定义
- TypeError:无法读取属性'findAll'的未定义