{"record":{"id":"72e18e91e6ac8d4d","repo":"remix-run/react-router","slug":"the-path-filepath-was-not-found-in-this-isg","errorCode":null,"errorMessage":"The path \"${filePath}\" was not found in this ${isGithubUrl ? \"GitHub repo.\" : \"tarball.\"}","messagePattern":"The path \"(.+?)\" was not found in this (.+?)","errorType":"exception","errorClass":"CopyTemplateError","httpStatus":null,"severity":"error","filePath":"packages/create-react-router/copy-template.ts","lineNumber":340,"sourceCode":"        },\n        ignore(_filename, header) {\n          if (!header) {\n            throw Error(\"Header is undefined\");\n          }\n          return header.name === \"__IGNORE__\";\n        },\n      }),\n    );\n  } catch {\n    throw new CopyTemplateError(\n      \"There was a problem extracting the file from the provided template.\" +\n        `  Template URL: \\`${tarballUrl}\\`` +\n        `  Destination directory: \\`${downloadPath}\\``,\n    );\n  }\n\n  if (filePath && !filePathHasFiles) {\n    throw new CopyTemplateError(\n      `The path \"${filePath}\" was not found in this ${\n        isGithubUrl ? \"GitHub repo.\" : \"tarball.\"\n      }`,\n    );\n  }\n}\n\n// Copied from react-router-node/stream.ts\nasync function writeReadableStreamToWritable(\n  stream: ReadableStream,\n  writable: stream.Writable,\n) {\n  let reader = stream.getReader();\n  let flushable = writable as { flush?: Function };\n\n  try {\n    while (true) {\n      let { done, value } = await reader.read();","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/remix-run/react-router/blob/1fd704a7dabcbe3ae09d7387b460e6acaba30ec1/packages/create-react-router/copy-template.ts#L322-L358","documentation":"Thrown after a successful download+extract when a filePath (subdirectory) was requested but no tar entries matched it — filePathHasFiles stayed false. The filePath is set when you use owner/repo/subdir shorthand or a /tree/:branch/:dir URL; the map() hook marks entries '__IGNORE__' unless their name starts with filePath, and if none ever matched, the requested subdirectory does not exist in the archive.","triggerScenarios":"--template remix-run/react-router/templates/not-a-real-dir; a /tree/main/examples/missing URL; the directory was renamed since the URL was copied; case mismatch in the path (Templates vs templates); the path exists only on a different branch than the one resolved.","commonSituations":"Template path copied from old docs after upstream restructure; using a branch where the subdir does not exist; typo in the nested path segment; expecting a directory but the path is actually a single file.","solutions":["Browse the repo at the resolved branch and copy the exact directory path (case-sensitive).","If using /tree/:branch/:dir, confirm :branch exists and contains the directory.","Try the owner/repo shorthand with a verified subdirectory: --template remix-run/react-router/<verified-dir>.","Omit the subdirectory to pull the whole repo, then move the desired folder out manually."],"exampleFix":"// before -- subdir renamed upstream\ncreate-react-router my-app --template https://github.com/remix-run/react-router-templates/tree/main/old-name\n// after -- verify the path on GitHub and use the current name\ncreate-react-router my-app --template https://github.com/remix-run/react-router-templates/tree/main/default","handlingStrategy":"validation","validationCode":"// Confirm a subdirectory exists in the repo's default branch via the contents API\nasync function subdirExists(owner: string, repo: string, branch: string, dir: string, token?: string) {\n  const url = `https://api.github.com/repos/${owner}/${repo}/contents/${dir}?ref=${branch}`;\n  const h: HeadersInit = { Accept: 'application/vnd.github.v3+json' };\n  if (token) h.Authorization = `token ${token}`;\n  const r = await fetch(url, { headers: h });\n  if (!r.ok) return false;\n  const body = await r.json();\n  return Array.isArray(body);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify subdirectory paths against the repo at the exact branch.","Treat paths as case-sensitive.","If unsure, pull the whole repo (--template owner/repo) and move the folder manually.","Re-copy template paths from current docs after upstream renames."],"tags":["template","path","github","create-react-router"],"backgroundTag":null,"analyzedSha":"1fd704a7dabcbe3ae09d7387b460e6acaba30ec1","analyzedAt":"2026-08-12T13:54:57.804Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}