-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
Bug Description
The custom column formatter shows a false "Unexpected token '"', "" is not valid JSON" error in the editor even when the formatter is working correctly and producing valid output.
Repro Steps
- Open a table with a BLOB column containing JSON data stored as UTF-8 bytes (hex-encoded, e.g.
0x7b...) - Click the column header menu → Format Column
- Select Create Custom Formatter
- Enter the following code:
(value) => {
if (!value) return '';
const hex = String(value).replace(/^0x/, '');
const str = hex.match(/.{1,2}/g)
.map(byte => String.fromCharCode(parseInt(byte, 16)))
.join('');
const parsed = JSON.parse(str);
return `<pre><code>${JSON.stringify(parsed, null, 2)}</code></pre>`;
}- Observe that the Output panel correctly renders the decoded JSON
- Observe that the editor header still shows:
Unexpected token '"', "" is not valid JSON
Expected Behavior
No error should be shown when the formatter produces valid output. The error indicator should only appear if the formatter actually fails to execute or throws an exception.
Actual Behavior
The formatter works correctly — the Output panel displays properly formatted JSON — but the editor simultaneously shows a false positive error message, causing confusion about whether the formatter is valid.
Environment
- DBCode version: 1.28.13
- VS Code version: 1.110.1 (Universal)
- OS: Macos
- Database: SQLite
- Connection: File (local)
Error Messages
Unexpected token '"', "" is not valid JSON

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels