{"record":{"id":"c7349bbdafe74190","repo":"dotnet/aspnetcore","slug":"renderer-with-id-rendererid-is-not-listening","errorCode":null,"errorMessage":"Renderer with ID '${rendererId}' is not listening for navigation events","messagePattern":"Renderer with ID '(.+?)' is not listening for navigation events","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/Components/Web.JS/src/Services/NavigationManager.ts","lineNumber":69,"sourceCode":"  });\n\n  if (hasRegisteredNavigationEventListeners) {\n    return;\n  }\n\n  hasRegisteredNavigationEventListeners = true;\n  window.addEventListener('popstate', onPopState);\n  currentHistoryIndex = history.state?._index ?? 0;\n\n  attachEnhancedNavigationListener((internalDestinationHref, interceptedLink) => {\n    notifyLocationChanged(interceptedLink, internalDestinationHref);\n  });\n}\n\nfunction setHasLocationChangingListeners(rendererId: WebRendererId, hasListeners: boolean) {\n  const callbacks = navigationCallbacks.get(rendererId);\n  if (!callbacks) {\n    throw new Error(`Renderer with ID '${rendererId}' is not listening for navigation events`);\n  }\n  callbacks.hasLocationChangingEventListeners = hasListeners;\n}\n\n\nexport function attachToEventDelegator(eventDelegator: EventDelegator): void {\n  // We need to respond to clicks on <a> elements *after* the EventDelegator has finished\n  // running its simulated bubbling process so that we can respect any preventDefault requests.\n  // So instead of registering our own native event, register using the EventDelegator.\n  eventDelegator.notifyAfterClick(event => {\n    if (!hasInteractiveRouter()) {\n      return;\n    }\n\n    handleClickForNavigationInterception(event, absoluteInternalHref => {\n      performInternalNavigation(absoluteInternalHref, /* interceptedLink */ true, /* replace */ false);\n    });\n  });","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Web.JS/src/Services/NavigationManager.ts#L51-L87","documentation":"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.","triggerScenarios":".NET invoking setHasLocationChangingListeners(rendererId, ...) before listenForNavigationEvents(rendererId, ...) was called for that rendererId; or after the callbacks entry was removed.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function rendererIsListeningForNavigation(rendererId: number): boolean {\n  // (navigationCallbacks is private; expose a capability check in your host, or rely on framework ordering)\n  return typeof window !== 'undefined' && (window as any).Blazor?._internal?.navigationCallbacks?.has?.(rendererId) === true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not call internalFunctions.setHasLocationChangingListeners directly.","Let the framework wire listenForNavigationEvents during circuit startup.","Keep renderer ids consistent between .NET and JS."],"tags":["blazor","navigation","renderer","location-changing","lifecycle"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}