252 | this.startPingTimer();
253 | }
254 | });
255 | }
256 | parseChat(chat, isRecent = false) {
257 | const profile = JSON.parse(chat['profile']);
^
SyntaxError: JSON Parse error: Unexpected identifier "undefined"
at parseChat (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:257:25)
at /home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:243:41
at /home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:8:9
at new Promise (:1:21)
at /home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:4:12
Node.js
undefined:1
undefined
^
SyntaxError: "undefined" is not valid JSON
at JSON.parse ()
at ChzzkChat.parseChat (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:257:30)
at ChzzkChat. (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:243:46)
at Generator.next ()
at /home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:8:71
at new Promise ()
at __awaiter (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:4:12)
at ChzzkChat.handleMessage (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:196:16)
at callListener (/home/ubuntu/chzzkbot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/ubuntu/chzzkbot/node_modules/ws/lib/event-target.js:209:9)
Bun 최신 버전, Node.js 21에서 공통적으로 발생하는 문제입니다.
Bun
Node.js
SyntaxError: "undefined" is not valid JSON at JSON.parse ()
at ChzzkChat.parseChat (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:257:30)
at ChzzkChat. (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:243:46)
at Generator.next ()
at /home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:8:71
at new Promise ()
at __awaiter (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:4:12)
at ChzzkChat.handleMessage (/home/ubuntu/chzzkbot/node_modules/chzzk/dist/chat/chat.js:196:16)
at callListener (/home/ubuntu/chzzkbot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/ubuntu/chzzkbot/node_modules/ws/lib/event-target.js:209:9)
Node.js v21.6.1