Migrating to Remix fetch-router@0.20.0
Version fetch-router@0.20.0 introduces 2 breaking changes. This guide details how to update your code.
Released: 6/5/2026
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
Middlewarerouter.mountRouteBuilderRouteInstallerRouterContextcreateActionroutemapcreateControllerMapTargetMapHandlercreateMiddlewareBreaking Changes
●Issue #1
Middleware must now explicitly continue the request chain by calling `next()` or return a `Response`. The router no longer calls `next()` automatically when middleware returns `undefined`; it throws an error instead.
●Issue #2
The `MapTarget` and `MapHandler` types are no longer exported. Use the public `Router`, `RouteBuilder`, `RouteInstaller`, `Action`, and `Controller` types instead.
Migration Steps
- 1Ensure all middleware functions explicitly call `next()` and return its result, or return a `Response` object.
- 2If middleware only mutates context, it should return the result of `next()` (e.g., `return next()`).
- 3If middleware needs to inspect or modify the downstream response, it must `await next()` and return the resulting response (e.g., `let response = await next(); return response`).
Release Summary
This release introduces router mounting for reusable route groups and significantly updates middleware behavior to require explicit continuation or response return, improving error detection. It also enhances context inference for actions and controllers based on inline middleware.
Need More Details?
View the full release notes and all changes for Remix fetch-router@0.20.0.
View Full Changelog