GoRouter.dev

Current field guide · 2026

Trace the route, not the symptom

Inspect the requested URI, matched hierarchy, redirect decisions, and selected Navigator before changing your configuration.

Edition published 21 Oct 2026go_router 18.1.1 reference
On this page

Turn on route diagnostics

Enable debugLogDiagnostics while developing. Use logs to compare the destination you requested with the route map you actually registered. Avoid logging complete user URLs if they can contain sensitive query values.

Narrow the failure

Does the problem happen before matching, during redirection, while building a screen, or only after browser reload? A route that works through a button but fails after refresh often points to hosting rather than the route builder.

Check shell ownership

When a page appears underneath a tab bar instead of above it, inspect the Navigator keys and parentNavigatorKey. When a tab loses state, check whether the design uses separate stateful branches and whether keys or router instances are being recreated.

Reduce before reporting

Build the smallest route tree that still fails. Record package and Flutter versions, entry URI, steps, expected behavior, and actual behavior. Remove tokens and private data before attaching logs to an upstream issue.

dart / example
final router = GoRouter(
  debugLogDiagnostics: true,
  routes: routes,
  errorBuilder: (context, state) => UnknownLocationScreen(
    message: 'This location is not available.',
  ),
);
Earlier edition: read the complete original guide. Its older APIs are kept in historical context.

Sources & version context

GoRouter.dev documentation edition. Examples illustrate the APIs described in the linked primary documentation. Adapt application-owned widgets and services to your project. They are not an executed Flutter session in this browser.

Find your next route