From b21c9acb0d57fa1207f673acf740fc8b100b625d Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 25 Jan 2026 11:04:32 +0100 Subject: [PATCH] fix(routes): restore SPA routing after Echo v5 upgrade In Echo v5, the 404 error for unmatched routes implements the HTTPStatusCoder interface but is not a *HTTPError. This caused the static middleware to fail to catch 404s and serve index.html for SPA routes, leading to reloading SPA routes returning 404. Caused by regression introduced in 9a61453e8. Fixes #2149 Fixes #2152 --- pkg/routes/static.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/routes/static.go b/pkg/routes/static.go index 74083c2f7..3f5162829 100644 --- a/pkg/routes/static.go +++ b/pkg/routes/static.go @@ -166,8 +166,8 @@ func static() echo.MiddlewareFunc { return err } - var he *echo.HTTPError - if !errors.As(err, &he) || he.Code != http.StatusNotFound { + var he echo.HTTPStatusCoder + if !errors.As(err, &he) || he.StatusCode() != http.StatusNotFound { return err }