-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
express框架中调用render()出现栈溢出问题 #624
Comments
我也遇到这个问题,请问解决了吗?我暂时是过滤_id |
mongoose版本过高导致的,我写的版本是: package.json文件:
|
好的学习了,谢谢,网上还有一种方法是把Mongo对象转成普通对象,说是mongo对象内部维护的信息太多了导致爆栈,试过了这样确实没问题,不过应该还是是环境的问题,因为我的数据量非常非常低不至于爆掉栈空间 |
谢谢! 我找了很久, 最后用你说的转对象的方法解决了, 先用了 JSON.stringify() 转成字符串, 再用了 JSON.parse() 转回对象. |
//控制台报错信息
RangeError: Maximum call stack size exceeded
at Buffer.get [Symbol.toStringTag] ()
at Buffer.toString ()
at toType (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:7:47)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:20:16)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
at extend (C:\Users\piCzhang\Desktop\project_blog\node_modules\art-template\lib\compile\adapter\extend.js:31:33)
//问题描述
只有在使用populate进行多表联查才会出现这个问题,但是把主表里面的_id字段过滤掉就不会出现这个问题
//异常代码段
//使用的模型Article
//联查使用的模型User
The text was updated successfully, but these errors were encountered: