Where it shows up
When the extension activates inside the monaco-vscode-api web worker extension host, the browser console logs (3+ times per activation):
extensionHost.worker-<hash>.js:45 'addEventListener' has been blocked
self.addEventListener @ extensionHost.worker-<hash>.js:45
eval @ speclynxClientMain.js:9
eval @ speclynxClientMain.js:9
eval @ speclynxClientMain.js:9
_loadCommonJSModule @ extensionHost.worker-<hash>.js:45
What's happening
speclynxClientMain.js (the bundled extension entry, loaded as a CommonJS module by the worker extension host) calls self.addEventListener(...) at module scope. The host froze self before evaluating the extension module, so the call is silently rejected. The toolkit continues to work — Scalar preview renders, language features activate — but the warning fires every activation.
Repro
Observed in https://github.com/speclynx/speclynx-editor running monaco-vscode-api 32.x with the bundled VSIX. Should also reproduce in vscode.dev / github.dev or any other web host that loads the toolkit through the web worker extension host.
Suggested fix
Drop the top-level self.addEventListener(...) call (or guard it) and use the corresponding VSCode API. If the listener is required for a specific feature, please document which so it can be ported to a worker-safe equivalent.
if (typeof self !== 'undefined' && typeof self.addEventListener === 'function') {
try { self.addEventListener(eventName, handler) } catch { /* sandboxed host */ }
}
Where it shows up
When the extension activates inside the monaco-vscode-api web worker extension host, the browser console logs (3+ times per activation):
What's happening
speclynxClientMain.js(the bundled extension entry, loaded as a CommonJS module by the worker extension host) callsself.addEventListener(...)at module scope. The host frozeselfbefore evaluating the extension module, so the call is silently rejected. The toolkit continues to work — Scalar preview renders, language features activate — but the warning fires every activation.Repro
Observed in https://github.com/speclynx/speclynx-editor running monaco-vscode-api 32.x with the bundled VSIX. Should also reproduce in vscode.dev / github.dev or any other web host that loads the toolkit through the web worker extension host.
Suggested fix
Drop the top-level
self.addEventListener(...)call (or guard it) and use the corresponding VSCode API. If the listener is required for a specific feature, please document which so it can be ported to a worker-safe equivalent.