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
Error Reproduction
Why this matters
Proposed fix
If requesting a hidden exported property (
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.