{"record":{"id":"7c5b30183c994d19","repo":"emberjs/ember.js","slug":"url","errorCode":null,"errorMessage":"${_url}","messagePattern":"\\$\\{_url\\}","errorType":"exception","errorClass":"UnrecognizedURLError","httpStatus":null,"severity":"error","filePath":"packages/router_js/lib/transition-intent/url-transition-intent.ts","lineNumber":36,"sourceCode":"  applyToState(oldState: TransitionState<R>) {\n    let newState = new TransitionState<R>();\n    let results = this.router.recognizer.recognize(this.url),\n      i,\n      len;\n\n    if (!results) {\n      throw new UnrecognizedURLError(this.url);\n    }\n\n    let statesDiffer = false;\n    let _url = this.url;\n\n    // Checks if a handler is accessible by URL. If it is not, an error is thrown.\n    // For the case where the handler is loaded asynchronously, the error will be\n    // thrown once it is loaded.\n    function checkHandlerAccessibility(handler: R) {\n      if (handler && handler.inaccessibleByURL) {\n        throw new UnrecognizedURLError(_url);\n      }\n\n      return handler;\n    }\n\n    for (i = 0, len = results.length; i < len; ++i) {\n      let result = results[i]!;\n      let name = result.handler as string;\n      let paramNames: string[] = [];\n\n      if (this.router.recognizer.hasRoute(name)) {\n        paramNames = this.router.recognizer.handlersFor(name)[i].names;\n      }\n\n      let newRouteInfo = new UnresolvedRouteInfoByParam(\n        this.router,\n        name,\n        paramNames,","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/router_js/lib/transition-intent/url-transition-intent.ts#L18-L54","documentation":"checkHandlerAccessibility throws UnrecognizedURLError when a route handler matched by the URL sets `inaccessibleByURL = true`. The URL resolves to routes, but one of them forbids being entered directly via URL, so the transition is treated as an unrecognized URL.","triggerScenarios":"Navigating directly to a URL whose handler object defines inaccessibleByURL = true (common on engine route handlers or routes only reachable via transitionTo with contexts).","commonSituations":"Routes that require a parent context/model and are meant to be entered only via transitionTo('route', model); route-less/engine mount points; deep-linking to a child route that depends on in-memory state.","solutions":["Remove the inaccessibleByURL flag if the route should be deep-linkable, and make its model hooks self-sufficient.","Redirect from an accessible parent/entry route instead of expecting direct URL entry.","Catch the error at the router level and transition to a sensible default route.","Restructure the route so required context can be reconstructed from URL params."],"exampleFix":"// before\nexport default Route.extend({ inaccessibleByURL: true });\n// after\nexport default Route.extend({\n  model(params) { return this.store.findRecord('post', params.post_id); }\n});","handlingStrategy":"try-catch","validationCode":"// Before deep-linking, confirm no handler in the chain sets inaccessibleByURL\nfunction deepLinkAllowed(handlerInfos) {\n  return handlerInfos.every(h => !h.handler || h.handler.inaccessibleByURL !== true);\n}","typeGuard":"function isURLAccessible(handler) { return !(handler && handler.inaccessibleByURL === true); }","tryCatchPattern":"router.handleURL(url).catch(e => {\n  if (e.name === 'UnrecognizedURLError') { router.transitionTo('index'); }\n  else throw e;\n});","preventionTips":["Only mark routes inaccessibleByURL when entry context truly cannot be reconstructed.","Provide an alternative entry route for protected child routes.","Document inaccessibleByURL routes so team members know deep links fail.","Reconstruct required state from params in model hooks to keep URLs shareable."],"tags":["routing","unrecognized-url","ember"],"backgroundTag":"unrecognized-url","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}