Open bruceharrison1984 opened 12 months ago
You are right. I wasn't aware of this issue.
Not sure what the fix would be, perhaps just making the user register it manually is the easiest path forward, or just noting this in the documentation.
Yeah. I'll think about it and leave this issue open until the next action. Thanks.
In using the
@sonikjs/cloudflare-pages
, I noticed that static assets would not be served correctly if I created a new instance of Hono in my route, for purposes of adding additional middleware. This would cause all static assets to return a 404.Non-working:
Manually registering the
serveStatic
middleware from [Hono] works:So it seems like the root issue is that the middleware is registered immediately, and if the developer creates a new instance of Hono, this original registration is lost. Not sure what the fix would be, perhaps just making the user register it manually is the easiest path forward, or just noting this in the documentation.