From 2cbd17a6d72663cbabdf0e35bfcd0553685fd9cd Mon Sep 17 00:00:00 2001 From: ImFurina <222616389+MoeFurina@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:08:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(typeerror):=20=E5=B0=9D=E8=AF=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dvercel=E8=B0=83=E7=94=A8=20500=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 2640556..ad8499f 100644 --- a/server.js +++ b/server.js @@ -208,7 +208,9 @@ async function consturctServer(moduleDefs) { // Register the route. app.use(moduleDef.route, async (req, res) => { ;[req.query, req.body].forEach((item) => { - if (typeof item.cookie === 'string') { + // item may be undefined (some environments / middlewares). + // Guard access to avoid "Cannot read properties of undefined (reading 'cookie')". + if (item && typeof item.cookie === 'string') { item.cookie = cookieToJson(decode(item.cookie)) } })