上个星期写了一个简单的项目:Express+mongoDB框架。当时候执行正常。 但是刚刚执行发现,报错了错误提示如下: 希望前辈能帮忙指导,怎么解决这个问题!先感谢了。
TypeError: req.next is not a function at fn (f:\work\node\microblog\node_modules\express\lib\response.js:797:25) at Function.app.render (f:\work\node\microblog\node_modules\express\lib\application.js:505:5) at ServerResponse.res.render (f:\work\node\microblog\node_modules\express\lib\response.js:802:7) at Layer.handle (f:\work\node\microblog\app.js:91:13) at trim_prefix (f:\work\node\microblog\node_modules\express\lib\router\index.js:235:17) at f:\work\node\microblog\node_modules\express\lib\router\index.js:208:9 at Function.proto.process_params (f:\work\node\microblog\node_modules\express\lib\router\index.js:269:12) at next (f:\work\node\microblog\node_modules\express\lib\router\index.js:199:19) at trim_prefix (f:\work\node\microblog\node_modules\express\lib\router\index.js:237:11) at f:\work\node\microblog\node_modules\express\lib\router\index.js:208:9 at Function.proto.process_params (f:\work\node\microblog\node_modules\express\lib\router\index.js:269:12) at next (f:\work\node\microblog\node_modules\express\lib\router\index.js:199:19) at f:\work\node\microblog\node_modules\express\lib\router\index.js:137:5 at f:\work\node\microblog\node_modules\express\lib\router\index.js:250:10 at next (f:\work\node\microblog\node_modules\express\lib\router\index.js:160:14) at next (f:\work\node\microblog\node_modules\express\lib\router\index.js:176:38)
req.next不是函数,错误是这个文件的91行f:\work\node\microblog\app.js,因为估计你没有取到合适的req
自己看看你的逻辑是不是异步造成的
谢谢。已经解决
@camillalo 请问下楼主,是什么原因啊 。我这边也遇到同样的问题
你好 请问是怎样解决的
next 不是函数