next-session showing "API resolved without sending a response" log message every request
stokescomp opened this issue · 2 comments
stokescomp commented
I installed next-session
Then I make a file in api/withsession.js
import { withSession } from 'next-session';
const handler = (req, res) => {
req.session.views = req.session.views ? (req.session.views + 1) : 1;
res.send(`In this session, you have visited this website ${req.session.views} time(s).`)
};
export default withSession(handler);
It shows this message every time I visit this page in the logs.
API resolved without sending a response for /api/withsession, this may result in a stalled requests.
hoangvvo commented
This was due to vercel/next.js#9999.
It is just a harmless warning and should not cause any actual error in production because the way next-session
in written. I will soon update the package to avoid this warning.