Frontmatter
| id | 8865 |
| title | Fix Manager runtime errors in dist/prod (promises init & getWorker check) |
| state | Closed |
| labels | bugaicore |
| assignees | tobiu |
| createdAt | Jan 22, 2026, 12:16 PM |
| updatedAt | Jan 22, 2026, 12:37 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8865 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 22, 2026, 12:37 PM |
Fix Manager runtime errors in dist/prod (promises init & getWorker check)

tobiu
Jan 22, 2026, 12:36 PM
Input from Gemini 3 Pro:
✦ I have applied the fix for the runtime errors in
dist/production.Changes:
- Manager Initialization: Moved
me.promises = {}to the very top ofconstruct()insrc/worker/Manager.mjs. This guarantees it is initialized before any other logic runs, resolving theCannot set properties of undefinederror.- GetWorker Safety: Added a safety check in
getWorker()to preventCannot read properties of undefinedwhen accessing worker instances.Verification: The user verified the fix by enabling logs in
dist/development(which mirrors the production environment logic) and confirming that the errors are resolved andpromiseMessagecalls are successful.The changes have been committed and pushed to
dev.
tobiu assigned to @tobiu on Jan 22, 2026, 12:36 PM
tobiu closed this issue on Jan 22, 2026, 12:37 PM
The
dist/productionbuild of Portal App throws two errors on the Main Thread:Cannot set properties of undefined (setting 'neo-5')inpromiseMessage.me.promisesappears to be undefined whencheckServiceWorkerVersionis called duringconstruct. Even though it is assigned inconstruct, the Native ESM build output may be affecting execution order or scope in unexpected ways.promisesto a class field. This guarantees it is initialized immediately upon instantiation, well beforeconstruct()is called.Cannot read properties of undefined (reading 'worker')ingetWorker.getWorkerattempts to accessthis.workers[name].workerwithout verifying ifthis.workers[name]exists.if (this.workers[name]) ....Tasks:
src/worker/Manager.mjs:promises = {}as a class field.me.promises = {}fromconstruct.getWorkerto safely check forthis.workers[name].