Not sure if this is a #wrangler or #
Not sure if this is a #wrangler or #miniflare issue, but the following code will throw in
wrangler dev
(ignored/safe in production):
Error Reproduction
Why this matters
itty-router
routers have a Proxy trap on the prototype chain. If we export our router directly (ideal), a request to "middleware" returns a function, throwing when internal wrangler code tries to iterate it.
Proposed fix
If requesting a hidden exported property (middleware
) and iterating over it, there should at least be checks to verify if the item is iterable before attempting to iterate.3 Replies
(the thrown error)
@Kevin W - Itty could you file an issue for this in our repo so we can take a look? https://github.com/cloudflare/workers-sdk/issues
That repo is for wrangler and miniflare so we can sort it out there.
Thanks!
GitHub
🐛 BUG: wrangler dev throws if finding a non-iterable middleware exp...
Which Cloudflare product(s) does this pertain to? Wrangler core What version(s) of the tool(s) are you using? 3.39.0 [Wrangler] What version of Node are you using? 20.10.0 What operating system and...