Problem
The packaged Code OSS 1.137.0 AppScene audit reaches Monaco worker startup, then logs these events at the same timestamp:
Could not create web worker(s). Falling back to loading web worker code in main thread...
Unhandled promise rejection: Uncaught TypeError: Unable to resolve bare module specifier: module
Evidence is in artifacts/release-ad89179-feature-audit/stderr.log, sequences 34-37.
This is a generic worker-global compatibility gap. Code OSS src/vs/amdX.ts detects a worker with:
typeof self === 'object' && self.constructor &&
self.constructor.name === 'DedicatedWorkerGlobalScope'
WebScene creates a real isolated worker runtime and assigns self to the global object, but does not install the browser WorkerGlobalScope / DedicatedWorkerGlobalScope identity. Code OSS therefore chooses _nodeJSLoadScript() instead of _workerLoadScript() and runs import('module'). WebScene correctly rejects that bare Node builtin, which masks the primary worker-global identity failure and causes Monaco to report worker startup failure.
Proposed fix
- Give dedicated-worker globals browser-compatible
WorkerGlobalScope and DedicatedWorkerGlobalScope constructor/prototype identity, including self.constructor.name === 'DedicatedWorkerGlobalScope' and self instanceof DedicatedWorkerGlobalScope.
- Preserve the isolated worker runtime, EventTarget behavior, module loading, and bounded message queues.
- Add a Code OSS-shaped WPT/regression that makes the same loader selection and proves the worker branch runs.
- Run the existing worker throughput and queue bounds gates to confirm no performance regression.
Acceptance
- A module worker reports the expected DedicatedWorkerGlobalScope identity.
- Code OSS-shaped worker detection selects its dynamic URL import path rather than the Node builtin path.
- Existing worker/iframe, structured clone, termination, throughput, and capacity tests remain green.
- Rebuilt packaged Code OSS no longer emits the paired Monaco fallback / bare
module diagnostic.
Related to #81, but independently testable as worker-global API identity.
Problem
The packaged Code OSS 1.137.0 AppScene audit reaches Monaco worker startup, then logs these events at the same timestamp:
Evidence is in
artifacts/release-ad89179-feature-audit/stderr.log, sequences 34-37.This is a generic worker-global compatibility gap. Code OSS
src/vs/amdX.tsdetects a worker with:WebScene creates a real isolated worker runtime and assigns
selfto the global object, but does not install the browserWorkerGlobalScope/DedicatedWorkerGlobalScopeidentity. Code OSS therefore chooses_nodeJSLoadScript()instead of_workerLoadScript()and runsimport('module'). WebScene correctly rejects that bare Node builtin, which masks the primary worker-global identity failure and causes Monaco to report worker startup failure.Proposed fix
WorkerGlobalScopeandDedicatedWorkerGlobalScopeconstructor/prototype identity, includingself.constructor.name === 'DedicatedWorkerGlobalScope'andself instanceof DedicatedWorkerGlobalScope.Acceptance
modulediagnostic.Related to #81, but independently testable as worker-global API identity.