Cant deploy worker using router class

Hello, I am trying to deploy a worker that uses a custom router but wrangler keeps throwing the error The uploaded script has no registered event handlers. [code: 10068] Which seems weird because the router has an async fetch handler and is the default export. From everything I have read, this should work? Am I missing something? I also tried extending the class using WorkerEntrypoint but it results in the error Uncaught TypeError: Failed to construct 'WorkerEntrypoint': constructor parameter 1 is not of type ExecutionContext'. which is odd because looking at the docs examples, a constructor shouldnt be needed.
No description
No description
1 Reply
hfcRed
hfcRedOP5mo ago
Solved, function needs to be an expression, not a declaration, my bad
No description
Want results from more Discord servers?
Add your server