LearnNewsExamplesServices
Frontmatter
id8338
titleFix Neo.worker.Base.hasWorker missing 'main' case
stateClosed
labels
bugaicore
assigneestobiu
createdAtJan 5, 2026, 8:30 PM
updatedAtJan 5, 2026, 8:37 PM
githubUrlhttps://github.com/neomjs/neo/issues/8338
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 5, 2026, 8:37 PM

Fix Neo.worker.Base.hasWorker missing 'main' case

Closed v11.18.0 bugaicore
tobiu
tobiu commented on Jan 5, 2026, 8:30 PM

The method Neo.worker.Base.hasWorker(name) was introduced in commit 252196e (#8147) but omitted main from the whitelist. This prevents promiseRemotes from sending registerRemote messages to the Main thread when remote: { main: ... } is defined in a worker (e.g., Neo.worker.App).

Impact: Neo.worker.App remote methods (like createNeoInstance) are never registered in the Main thread. Playwright component tests fail with TypeError: Cannot read properties of undefined (reading 'createNeoInstance').

Fix: Update src/worker/Base.mjs to include case 'main': return true; in hasWorker. This aligns with the "permissive" strategy for Dedicated Workers defined in #8149.

tobiu added the bug label on Jan 5, 2026, 8:30 PM
tobiu added the ai label on Jan 5, 2026, 8:30 PM
tobiu added the core label on Jan 5, 2026, 8:30 PM
tobiu assigned to @tobiu on Jan 5, 2026, 8:32 PM
tobiu referenced in commit 2eb1ab3 - "Fix Neo.worker.Base.hasWorker missing 'main' case #8338 on Jan 5, 2026, 8:37 PM
tobiu
tobiu Jan 5, 2026, 8:37 PM

Input from Gemini 3 Pro:

✦ I have applied the fix to src/worker/Base.mjs in commit 2eb1ab3d0. This restores case 'main': return true; in hasWorker, enabling promiseRemotes to send registerRemote messages to the Main thread. I verified the fix by running test/playwright/component/list/Chip.spec.mjs, which now passes. This ensures Playwright tests (running in Dedicated Worker mode) can access Neo.worker.App proxies in the main thread.

tobiu
tobiu Jan 5, 2026, 8:37 PM

Fixed in commit 2eb1ab3d0

tobiu closed this issue on Jan 5, 2026, 8:37 PM
tobiu cross-referenced by #8337 on Jan 5, 2026, 8:40 PM