Closed JustinGrote closed 1 year ago
Any chance you could test the itty-router@next
and see if this issue persists? If not, we can close this, as v3.0
should be rolling out any day now!
Closing this as version 3 is live with all new types. Let's start over and investigate with 3.x to see if this is still an issue!
Now that the latest cloudlfare worker types supports doing everything in a non-global way,
handle
should be able to be scoped to justPromise<Response>
per the fetch specification: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/#migrating-a-simple-workerRight now,
handle
is hardcoded to returnPromise<any>
https://github.com/kwhitley/itty-router/blob/73659e875d31a487f0825b459142a41f5ec2cdc8/src/itty-router.d.ts#L45Which results in a typescript error when passed to the module syntax worker:
And has to be forced currently.
Workaround