After change errors #20

Closed
opened 2026-07-12 15:13:36 +00:00 by Pakobbix · 3 comments
Owner

After the recent Changes for enhancing code quality and performance, we get these errors in the console after loading it in:

i18n.js:125 Loading locale data from ./locales/de-de.json
index.js:29 Notifications not allowed
(anonymous) @ index.js:29
Promise.then
(anonymous) @ index.js:3
index.js:19 [QR2] sets:  [QuickReplySet]
index.js:19 [QR2] settings:  QuickReplySettings {isEnabled: false, isCombined: false, isPopout: false, showPopoutButton: true, config: QuickReplyConfig, …}
script.js:7994 Settings not ready, scheduling another save
saveSettings @ script.js:7994
(anonymous) @ script.js:469
(anonymous) @ utils.js:578
jquery-highlight.js:7 Patching jQuery highlight
index.js:304 [RPG Companion] Starting initialization...
jsonCleaning.js:81 [RPG Companion] JSON Cleaning Regex is up to date.
injector.js:907 [RPG Companion] History injection listeners initialized
index.js:1183 [RPG Companion] ✅ Extension loaded successfully.
script.js:7994 Settings not ready, scheduling another save
saveSettings @ script.js:7994
(anonymous) @ script.js:469
(anonymous) @ utils.js:578
setTimeout
fn @ utils.js:578
saveSettings @ script.js:7995
(anonymous) @ script.js:469
(anonymous) @ utils.js:578
index.js:1183 STMemoryBooks: Initializing
script.js:1529 Rendered 3 messages in 0.030 seconds.
index.js:1183 [QR2] calling {args: Array(1), functionToCall: ƒ}
index.js:1183 [QR2] CHAT_CHANGED Growing Free Spirit - 2026-07-09@19h58m55s551ms
desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1)
    at JSON.parse (<anonymous>)
    at updateStripWidgets (desktop.js:53:59)
    at flushRenders (renderUtils.js:63:13)
updateStripWidgets @ desktop.js:55
flushRenders @ renderUtils.js:63
requestAnimationFrame
scheduleRender @ renderUtils.js:46
rerenderRpgState @ sillytavern.js:333
onCharacterChanged @ sillytavern.js:713
EventEmitter.emit @ eventemitter.js:146
await in EventEmitter.emit
getChatResult @ script.js:7641
await in getChatResult
getChat @ script.js:7609
await in getChat
selectCharacterById @ script.js:899
await in selectCharacterById
openRecentCharacterChat @ welcome-screen.js:486
(anonymous) @ welcome-screen.js:362
index.js:1183 Using default persona user-default.png
desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1)
    at JSON.parse (<anonymous>)
    at updateStripWidgets (desktop.js:53:59)
    at flushRenders (renderUtils.js:63:13)
updateStripWidgets @ desktop.js:55
flushRenders @ renderUtils.js:63
requestAnimationFrame
scheduleRender @ renderUtils.js:46
rerenderRpgState @ sillytavern.js:333
onChatLoaded @ sillytavern.js:416
EventEmitter.emit @ eventemitter.js:146
await in EventEmitter.emit
getChat @ script.js:7610
await in getChat
selectCharacterById @ script.js:899
await in selectCharacterById
openRecentCharacterChat @ welcome-screen.js:486
(anonymous) @ welcome-screen.js:362
desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1)
    at JSON.parse (<anonymous>)
    at updateStripWidgets (desktop.js:53:59)
    at flushRenders (renderUtils.js:63:13)
updateStripWidgets @ desktop.js:55
flushRenders @ renderUtils.js:63
requestAnimationFrame
scheduleRender @ renderUtils.js:46
rerenderRpgState @ sillytavern.js:333
tryRestoreState @ sillytavern.js:377
setTimeout
scheduleChatStateRehydration @ sillytavern.js:409
onChatLoaded @ sillytavern.js:418
EventEmitter.emit @ eventemitter.js:146
await in EventEmitter.emit
getChat @ script.js:7610
await in getChat
selectCharacterById @ script.js:899
await in selectCharacterById
openRecentCharacterChat @ welcome-screen.js:486
(anonymous) @ welcome-screen.js:362
index.js:1183 Generate entered
index.js:1183 [QR2] calling {args: Array(3), functionToCall: ƒ}
index.js:1183 [QR2] Before-generation hook skipped due to dryRun.
index.js:1183 Core/all messages: 3/3
index.js:1183 [WI] Hypothetically adding 12 entries to prompt (12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
index.js:1183 skipWIAN not active, adding WIAN

Also, the Equipment tab is empty. Can't edit, add, delete or even see equipment.

After the recent Changes for enhancing code quality and performance, we get these errors in the console after loading it in: ``` i18n.js:125 Loading locale data from ./locales/de-de.json index.js:29 Notifications not allowed (anonymous) @ index.js:29 Promise.then (anonymous) @ index.js:3 index.js:19 [QR2] sets: [QuickReplySet] index.js:19 [QR2] settings: QuickReplySettings {isEnabled: false, isCombined: false, isPopout: false, showPopoutButton: true, config: QuickReplyConfig, …} script.js:7994 Settings not ready, scheduling another save saveSettings @ script.js:7994 (anonymous) @ script.js:469 (anonymous) @ utils.js:578 jquery-highlight.js:7 Patching jQuery highlight index.js:304 [RPG Companion] Starting initialization... jsonCleaning.js:81 [RPG Companion] JSON Cleaning Regex is up to date. injector.js:907 [RPG Companion] History injection listeners initialized index.js:1183 [RPG Companion] ✅ Extension loaded successfully. script.js:7994 Settings not ready, scheduling another save saveSettings @ script.js:7994 (anonymous) @ script.js:469 (anonymous) @ utils.js:578 setTimeout fn @ utils.js:578 saveSettings @ script.js:7995 (anonymous) @ script.js:469 (anonymous) @ utils.js:578 index.js:1183 STMemoryBooks: Initializing script.js:1529 Rendered 3 messages in 0.030 seconds. index.js:1183 [QR2] calling {args: Array(1), functionToCall: ƒ} index.js:1183 [QR2] CHAT_CHANGED Growing Free Spirit - 2026-07-09@19h58m55s551ms desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1) at JSON.parse (<anonymous>) at updateStripWidgets (desktop.js:53:59) at flushRenders (renderUtils.js:63:13) updateStripWidgets @ desktop.js:55 flushRenders @ renderUtils.js:63 requestAnimationFrame scheduleRender @ renderUtils.js:46 rerenderRpgState @ sillytavern.js:333 onCharacterChanged @ sillytavern.js:713 EventEmitter.emit @ eventemitter.js:146 await in EventEmitter.emit getChatResult @ script.js:7641 await in getChatResult getChat @ script.js:7609 await in getChat selectCharacterById @ script.js:899 await in selectCharacterById openRecentCharacterChat @ welcome-screen.js:486 (anonymous) @ welcome-screen.js:362 index.js:1183 Using default persona user-default.png desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1) at JSON.parse (<anonymous>) at updateStripWidgets (desktop.js:53:59) at flushRenders (renderUtils.js:63:13) updateStripWidgets @ desktop.js:55 flushRenders @ renderUtils.js:63 requestAnimationFrame scheduleRender @ renderUtils.js:46 rerenderRpgState @ sillytavern.js:333 onChatLoaded @ sillytavern.js:416 EventEmitter.emit @ eventemitter.js:146 await in EventEmitter.emit getChat @ script.js:7610 await in getChat selectCharacterById @ script.js:899 await in selectCharacterById openRecentCharacterChat @ welcome-screen.js:486 (anonymous) @ welcome-screen.js:362 desktop.js:55 [RPG Strip Widgets] Failed to parse infoBox: SyntaxError: Unexpected non-whitespace character after JSON at position 478 (line 26 column 1) at JSON.parse (<anonymous>) at updateStripWidgets (desktop.js:53:59) at flushRenders (renderUtils.js:63:13) updateStripWidgets @ desktop.js:55 flushRenders @ renderUtils.js:63 requestAnimationFrame scheduleRender @ renderUtils.js:46 rerenderRpgState @ sillytavern.js:333 tryRestoreState @ sillytavern.js:377 setTimeout scheduleChatStateRehydration @ sillytavern.js:409 onChatLoaded @ sillytavern.js:418 EventEmitter.emit @ eventemitter.js:146 await in EventEmitter.emit getChat @ script.js:7610 await in getChat selectCharacterById @ script.js:899 await in selectCharacterById openRecentCharacterChat @ welcome-screen.js:486 (anonymous) @ welcome-screen.js:362 index.js:1183 Generate entered index.js:1183 [QR2] calling {args: Array(3), functionToCall: ƒ} index.js:1183 [QR2] Before-generation hook skipped due to dryRun. index.js:1183 Core/all messages: 3/3 index.js:1183 [WI] Hypothetically adding 12 entries to prompt (12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] index.js:1183 skipWIAN not active, adding WIAN ``` Also, the Equipment tab is empty. Can't edit, add, delete or even see equipment.
Collaborator

I'll work on this. Give me a moment to inspect the codebase and prepare a fix.

I'll work on this. Give me a moment to inspect the codebase and prepare a fix.
ARIA self-assigned this 2026-07-12 15:14:12 +00:00
ARIA added the bug label 2026-07-12 15:14:12 +00:00
Collaborator

Both issues fixed:

  1. JSON parse errors — Replaced JSON.parse() with repairJSON() in desktop.js and mobile.js for infoBox/userStats parsing. Handles malformed JSON with trailing content.

  2. Empty equipment tab — Added defensive initialization in renderEquipment() (defaults showEquipment to true, ensures equipment data structure exists). Added explicit render call during init.

Tests: 78/78 passed.

PR: #21

Both issues fixed: 1. ✅ JSON parse errors — Replaced `JSON.parse()` with `repairJSON()` in desktop.js and mobile.js for infoBox/userStats parsing. Handles malformed JSON with trailing content. 2. ✅ Empty equipment tab — Added defensive initialization in `renderEquipment()` (defaults `showEquipment` to true, ensures equipment data structure exists). Added explicit render call during init. Tests: 78/78 passed. PR: https://gitea.zephyre.one/Pakobbix/rpg-companion-sillytavern/pulls/21
Collaborator

Found the root cause: the equipment section has display: none in CSS and updateSectionVisibility() (the function that calls .show()) was never called during init. Added it. Pushed fix to PR #21.

Found the root cause: the equipment section has `display: none` in CSS and `updateSectionVisibility()` (the function that calls `.show()`) was never called during init. Added it. Pushed fix to PR #21.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Pakobbix/rpg-companion-sillytavern#20