{"record":{"id":"d6ab5c96222e2110","repo":"refinedev/refine","slug":"no-resource-is-found-navigation-to-fallbackto-d6ab5c","errorCode":null,"errorMessage":"No resource is found. navigation to ${fallbackTo}.","messagePattern":"No resource is found\\. navigation to (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/nextjs-router/src/app/navigate-to-resource.tsx","lineNumber":41,"sourceCode":"    [resource, resources],\n  );\n\n  React.useEffect(() => {\n    if (toResource) {\n      if (!ran.current) {\n        const path = getToPath({\n          resource: toResource,\n          action: \"list\",\n          meta,\n        });\n\n        if (path) {\n          replace(path);\n        }\n        ran.current = true;\n      }\n    } else if (fallbackTo) {\n      console.warn(`No resource is found. navigation to ${fallbackTo}.`);\n      replace(fallbackTo);\n      ran.current = true;\n    }\n  }, [toResource, replace, meta, getToPath]);\n\n  return null;\n};\n","sourceCodeStart":23,"sourceCodeEnd":49,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/nextjs-router/src/app/navigate-to-resource.tsx#L23-L49","documentation":"Warned by `NavigateToResource` in the Next.js App Router package when the requested resource cannot be resolved to a path (not in resources, or no list route/meta) and a `fallbackTo` prop exists. The component then `replace()`s to fallbackTo. Same semantics as the react-router/remix variants — a resource-definition or naming mismatch, softened by the fallback.","triggerScenarios":"Rendering <NavigateToResource /> on an app-router index page where the default/`toResource` resource is absent from the <Refine resources> definitions (misnamed, missing list route, or no meta), with `fallbackTo` provided.","commonSituations":"Next.js App Router refine apps where the root page redirects to a resource list; resource renamed during refactors; index page copied from an example with different resource names.","solutions":["Match `toResource` (or the default first resource with a list) exactly to a `resources` entry name","Add `list: '/path'` or `meta: { route: ... }` to the resource so path resolution succeeds","Keep fallbackTo pointing at an always-valid route such as the dashboard"],"exampleFix":"// before\n<Refine resources={[{ name: 'products', list: '/products' }]} />\n// app/page.tsx\n<NavigateToResource toResource=\"product\" fallbackTo=\"/dashboard\" />\n// after\n<NavigateToResource toResource=\"products\" fallbackTo=\"/dashboard\" />","handlingStrategy":"validation","validationCode":"if (!resources.some((r) => r.name === target && r.list)) {\n  console.warn(`Resource ${target} unresolvable — fallbackTo will be used`);\n}","typeGuard":"const canResolve = (name: string) =>\n  resources.some((r) => r.name === name && (r.list ?? r.meta?.route));","tryCatchPattern":null,"preventionTips":["Keep an always-present dashboard route as fallbackTo","Add a smoke test rendering the index page to catch blank redirects in CI"],"tags":["navigation","nextjs","app-router","resources","refine"],"backgroundTag":"route-resource-not-found","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}