{"record":{"id":"35a8f4520a4acb29","repo":"framework7io/framework7","slug":"framework7-route-with-path-path-not-found","errorCode":null,"errorMessage":"Framework7: route with path \"${path}\" not found","messagePattern":"Framework7: route with path \"(.+?)\" not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/modules/router/router-class.js","lineNumber":323,"sourceCode":"    };\n  }\n\n  generateUrl(parameters = {}) {\n    if (typeof parameters === 'string') {\n      return parameters;\n    }\n    const { name, path, params, query } = parameters;\n    if (!name && !path) {\n      throw new Error('Framework7: \"name\" or \"path\" parameter is required');\n    }\n    const router = this;\n    const route = name ? router.findRouteByKey('name', name) : router.findRouteByKey('path', path);\n\n    if (!route) {\n      if (name) {\n        throw new Error(`Framework7: route with name \"${name}\" not found`);\n      } else {\n        throw new Error(`Framework7: route with path \"${path}\" not found`);\n      }\n    }\n    const url = router.constructRouteUrl(route, { params, query });\n\n    if (url === '') {\n      return '/';\n    }\n\n    if (!url) {\n      throw new Error(`Framework7: can't construct URL for route with name \"${name}\"`);\n    }\n    return url;\n  }\n\n  // eslint-disable-next-line\n  constructRouteUrl(route, { params, query } = {}) {\n    const { path } = route;\n    const toUrl = compile(path);","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/framework7io/framework7/blob/655759126686766530a027b2f8f369c991d63d1c/src/core/modules/router/router-class.js#L305-L341","documentation":"`generateUrl({ path })` searches all route tables for a route whose `path` matches. When none matches, it throws `route with path \"...\" not found`. This is the name-less branch of the same lookup that produces the \"name not found\" error.","triggerScenarios":"`router.generateUrl({ path: '/some/url/' })` where the path is not among the router's registered route paths (typo, missing trailing slash difference, or route living in another router).","commonSituations":"Path casing or trailing-slash mismatches; dynamic routes defined with different patterns; calling generateUrl on the wrong View's router.","solutions":["Match the path exactly as defined in the routes array (watch trailing slashes and case)","Use a route `name` instead of a raw path for safer lookups","Register the missing route if it was intended","Verify which router holds the route and call generateUrl on that router"],"exampleFix":"// before\nrouter.generateUrl({ path: '/About' }); // route defined as '/about/'\n\n// after\nrouter.generateUrl({ path: '/about/' });","handlingStrategy":"validation","validationCode":"function pathExists(router, path) {\n  const flat = (router.routes || []).flatMap(r => (r.routes ? r.routes : [r]));\n  return flat.some(r => r && r.path === path);\n}\nif (!pathExists(router, path)) console.warn(`Path ${path} not registered`);","typeGuard":"function routePathExists(router, path) {\n  const flat = (router.routes || []).flatMap(r => (r.routes ? r.routes : [r]));\n  return flat.some(r => r && r.path === path);\n}","tryCatchPattern":"try {\n  const url = router.generateUrl({ path });\n} catch (e) {\n  if (/route with path .* not found/.test(e.message)) {\n    console.error(`No route matches path \"${path}\"; check exact spelling/trailing slash`);\n  } else throw e;\n}","preventionTips":["Match route paths exactly, including trailing slashes","Prefer name-based generateUrl over raw paths","Keep all route definitions in one auditable module","Test URL generation for each route in CI"],"tags":["router","routes","url-generation","framework7"],"backgroundTag":"route-not-found","analyzedSha":"655759126686766530a027b2f8f369c991d63d1c","analyzedAt":"2026-09-02T19:48:40.711Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}