Error: req.flash() requires sessions

后端 未结 3 2126
遇见更好的自我
遇见更好的自我 2021-02-20 17:31

I\'m new to node and I\'m pretty sure I\'ve set up the middle ware and express to use flash messaging however I still get the error:

Error: req.flash() requires se

3条回答
  •  耶瑟儿~
    2021-02-20 17:47

    In my case the issue was that Redis was not listening. I found that out by enabling the logErrors property:

    new RedisStore({
      host: 'localhost',
      port: '6379',
      logErrors: true,
    });
    

    Which resulted in messages like these:

    Warning: connect-redis reported a client error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    

提交回复
热议问题