dotnet/aspnetcore · error
Renderer with ID '${rendererId}' is not listening for naviga
Error message
Renderer with ID '${rendererId}' is not listening for navigation events What it means
Thrown by setHasLocationChangingListeners (NavigationManager.ts:69) when .NET calls back to enable/disable location-changing listeners for a rendererId that was never registered via listenForNavigationEvents. The navigationCallbacks map has no entry for that renderer, so Blazor cannot toggle the listener flag — indicating the renderer skipped the listenForNavigationEvents step or used the wrong id.
Source
Thrown at src/Components/Web.JS/src/Services/NavigationManager.ts:69
});
if (hasRegisteredNavigationEventListeners) {
return;
}
hasRegisteredNavigationEventListeners = true;
window.addEventListener('popstate', onPopState);
currentHistoryIndex = history.state?._index ?? 0;
attachEnhancedNavigationListener((internalDestinationHref, interceptedLink) => {
notifyLocationChanged(interceptedLink, internalDestinationHref);
});
}
function setHasLocationChangingListeners(rendererId: WebRendererId, hasListeners: boolean) {
const callbacks = navigationCallbacks.get(rendererId);
if (!callbacks) {
throw new Error(`Renderer with ID '${rendererId}' is not listening for navigation events`);
}
callbacks.hasLocationChangingEventListeners = hasListeners;
}
export function attachToEventDelegator(eventDelegator: EventDelegator): void {
// We need to respond to clicks on <a> elements *after* the EventDelegator has finished
// running its simulated bubbling process so that we can respect any preventDefault requests.
// So instead of registering our own native event, register using the EventDelegator.
eventDelegator.notifyAfterClick(event => {
if (!hasInteractiveRouter()) {
return;
}
handleClickForNavigationInterception(event, absoluteInternalHref => {
performInternalNavigation(absoluteInternalHref, /* interceptedLink */ true, /* replace */ false);
});
});View on GitHub (pinned to 294cab2f9b)
Solutions
- Ensure the renderer's listenForNavigationEvents is called (normally automatic during Blazor circuit startup) before LocationChanging listeners are toggled.
- Verify renderer ids are consistent between .NET and JS (don't construct or reuse ids manually).
- Avoid calling internalFunctions.setHasLocationChangingListeners directly from app code.
- Reproduce on a fresh circuit; if it persists, check that Blazor.start completed.
Defensive patterns
Strategy: validation
Validate before calling
function rendererIsListeningForNavigation(rendererId: number): boolean {
// (navigationCallbacks is private; expose a capability check in your host, or rely on framework ordering)
return typeof window !== 'undefined' && (window as any).Blazor?._internal?.navigationCallbacks?.has?.(rendererId) === true;
} Prevention
- Do not call internalFunctions.setHasLocationChangingListeners directly.
- Let the framework wire listenForNavigationEvents during circuit startup.
- Keep renderer ids consistent between .NET and JS.
When it happens
Trigger: .NET invoking setHasLocationChangingListeners(rendererId, ...) before listenForNavigationEvents(rendererId, ...) was called for that rendererId; or after the callbacks entry was removed.
Common situations: A component subscribing to OnNavigateAsync (LocationChanging event) on a renderer whose navigation wiring hasn't been established; mismatched renderer ids between the JS and .NET sides; a second renderer instance not going through listenForNavigationEvents; custom hosts that call internalFunctions out of order.
Related errors
- Interop methods are already registered for renderer ${render
- Interop methods are not registered for renderer ${rendererId
- No interop methods are registered for renderer ${rendererId}
- ' {GetType().Name}' already initialized.
- ' {GetType().Name}' has not been initialized.
AI-assisted analysis of dotnet/aspnetcore@294cab2f9b (2026-08-06).
Data as JSON: /api/errors/c7349bbdafe74190.
Report an issue: GitHub.