You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
bruceharrison1984
changed the title
Cloudflare Pages plugin registers route pre-maturely
Cloudflare Pages plugin registers middleware prematurely
Sep 24, 2023
bruceharrison1984
changed the title
Cloudflare Pages plugin registers middleware prematurely
Cloudflare Pages plugin registers serveStatic middleware prematurely
Sep 24, 2023
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.
The text was updated successfully, but these errors were encountered: