Closed osseonews closed 1 year ago
Simply don't use the spread syntax the README recommends.
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
return router.handle(request, env, ctx);
},
};
Exactly as @alexgleason (thanks Alex!) recommends - I've run into the same recently... just need to update the README!
If you use the ES6 Module Syntax for the itty router per the documentation, the line,
.handle(...args)
throws an error:A spread argument must either have a tuple type or be passed to a rest parameter
- any idea how to fix this?