#7555 Possible race condition with static assets upload - "no registered event handlers"
Self-resolved by reporter: moved packages to dynamic imports. Maintainer confirmed not a race condition - error was user code lacking event handlers due to top-level import side effects.
Close with acknowledgment of resolution
Analysis Report
Issue Review: cloudflare/workers-sdk#7555
Summary
Non-deterministic deploy failures with "no registered event handlers" error when using Workers + Static Assets - reporter self-resolved by using dynamic imports.
Findings
- Created: 2024-12-15
- Updated: 2025-10-30
- Version: 3.95.0 → 4.60.0 (major version upgrade)
- Component: Wrangler, Workers + Assets
- Labels: bug, api, Workers + Assets
- Comments: 3
Key Evidence
Reporter self-resolved the issue: The reporter stated they "resolved the issue by moving two packages (braintrust, @babel/core) to be lazily imported (via dynamic imports)."
Maintainer explanation: @petebacondarwin clarified this was NOT a race condition with asset uploads. The error
The uploaded script has no registered event handlers. [code: 10068]indicates the Worker code itself doesn't have a valid event handler exported. He suggested checking that the Worker has a proper default export with afetch()handler.Root cause identified by reporter: The reporter hypothesized "there was some sort of non-determinism between the event handler existence check and module initialization side-effects" - the issue was in their own code's top-level imports causing problems, not a bug in Wrangler.
No PR fixes this issue: No merged PRs reference issue #7555, and the issue is not mentioned in the changelog.
Significant version gap: The issue was reported against wrangler 3.95.0, and the current version is 4.60.0 (major version change with many potential improvements).
Recommendation
Status: CLOSE
Reasoning: This issue was self-resolved by the reporter. The root cause was identified as problematic top-level imports in their Worker code (packages with side effects that interfered with event handler detection), not a bug in Wrangler. The maintainer's explanation confirmed this was user code issue, not an assets upload race condition.
Action: Close with comment acknowledging the resolution and thanking the reporter for following up.
Suggested Comment
Thanks for the follow-up @sleexyz! Since you resolved this by moving to dynamic imports, it sounds like the issue was related to how those packages' top-level side effects interacted with the Worker's event handler registration, rather than a bug in Wrangler's asset upload flow.
As @petebacondarwin noted, the error
[code: 10068]indicates the runtime couldn't find registered event handlers in your Worker - using dynamic imports was the right fix to avoid those packages' initialization code from interfering.I'm going to close this issue as resolved. If anyone else encounters similar non-deterministic deploy failures, try moving heavy dependencies with side effects to dynamic imports.
Notes & Feedback (0)
No notes yet.