Using the current nightly I have an issue where my Line 6 Pod Go will not connect via MIDI. As soon as I open the MIDI amp control plugin I'm greeted with "MIDI access denied esc is not defined". Because my programming skill dont got much past blink.ino I asked Claude. Here was the response. It found an issue in screen.js
Found it — and the real story is more specific (and better news) than my Electron-permissions guess last time.
Look at midiInit():
js
try {
_midiAccess = await navigator.requestMIDIAccess({ sysex: false });
_updateMidiDevices();
_midiAccess.onstatechange = _updateMidiDevices;
} catch (e) {
status.innerHTML = ... MIDI access denied ... ${e.message} ...;
}
_updateMidiDevices() runs inside that same try. And inside it:
js
for (const o of outputs) {
const selected = o.id === _midiOutput.id ? 'selected' : '';
html += <option value="${o.id}" ${selected}>${esc(o.name)}</option>;
}
_esc() gets called there — but it's never defined anywhere in this file. So the real sequence is: requestMIDIAccess() almost certainly succeeds, updateMidiDevices() runs to list your outputs, and it throws ReferenceError: esc is not defined mid-loop. That exception gets caught by the outer catch — the one meant for genuine permission failures — which slaps "MIDI access denied" on the front and the ReferenceError's own message ("esc is not defined") on the back. That's your exact string, made of two unrelated things stapled together.
In other words: MIDI access itself is very likely fine. This isn't a permissions problem — that was a reasonable guess without seeing the code, but it's not what's actually happening. It's a plain missing-function bug, and "MIDI access denied" is a mislabel.
It's not just this one spot, either — esc() is also called in midiSearchSongs() and midiEditSong(), wrapping song titles, artist names, and tone names before they go into innerHTML. So even patched around the init crash, searching for a song or opening a song's tone-mapping editor would hit the same wall.
Every call site wraps a string right before it's inserted into HTML, so esc was clearly meant to be a small escaping helper — it's just missing. Defining it fixes all three spots at once:
js
function esc(str) {
return String(str ?? '').replace(/[&<>"']/g, c => ({
'&': '&', '<': '<', '>': '>', '"': '"', "'": '''
}[c]));
}
Add that anywhere at the top level of screen.js — function declarations get hoisted, so it doesn't need to sit above the functions that call it, but near the top with the other module-level code is the natural spot.
If you're up for editing the plugin folder directly, that's the fastest way to get it working today. Still worth reporting upstream — though as I mentioned last time, this repo currently has issue creation restricted, so the core project's channels are probably the better route.
Using the current nightly I have an issue where my Line 6 Pod Go will not connect via MIDI. As soon as I open the MIDI amp control plugin I'm greeted with "MIDI access denied esc is not defined". Because my programming skill dont got much past blink.ino I asked Claude. Here was the response. It found an issue in screen.js
Found it — and the real story is more specific (and better news) than my Electron-permissions guess last time.
Look at midiInit():
js
try {
_midiAccess = await navigator.requestMIDIAccess({ sysex: false });
_updateMidiDevices();
_midiAccess.onstatechange = _updateMidiDevices;
} catch (e) {
status.innerHTML =
... MIDI access denied ... ${e.message} ...;}
_updateMidiDevices() runs inside that same try. And inside it:
js
for (const o of outputs) {
const selected = o.id === _midiOutput.id ? 'selected' : '';
html +=
<option value="${o.id}" ${selected}>${esc(o.name)}</option>;}
_esc() gets called there — but it's never defined anywhere in this file. So the real sequence is: requestMIDIAccess() almost certainly succeeds, updateMidiDevices() runs to list your outputs, and it throws ReferenceError: esc is not defined mid-loop. That exception gets caught by the outer catch — the one meant for genuine permission failures — which slaps "MIDI access denied" on the front and the ReferenceError's own message ("esc is not defined") on the back. That's your exact string, made of two unrelated things stapled together.
In other words: MIDI access itself is very likely fine. This isn't a permissions problem — that was a reasonable guess without seeing the code, but it's not what's actually happening. It's a plain missing-function bug, and "MIDI access denied" is a mislabel.
It's not just this one spot, either — esc() is also called in midiSearchSongs() and midiEditSong(), wrapping song titles, artist names, and tone names before they go into innerHTML. So even patched around the init crash, searching for a song or opening a song's tone-mapping editor would hit the same wall.
Every call site wraps a string right before it's inserted into HTML, so esc was clearly meant to be a small escaping helper — it's just missing. Defining it fixes all three spots at once:
js
function esc(str) {
return String(str ?? '').replace(/[&<>"']/g, c => ({
'&': '&', '<': '<', '>': '>', '"': '"', "'": '''
}[c]));
}
Add that anywhere at the top level of screen.js — function declarations get hoisted, so it doesn't need to sit above the functions that call it, but near the top with the other module-level code is the natural spot.
If you're up for editing the plugin folder directly, that's the fastest way to get it working today. Still worth reporting upstream — though as I mentioned last time, this repo currently has issue creation restricted, so the core project's channels are probably the better route.