{"record":{"id":"690a31ed93be6143","repo":"vercel/next.js","slug":"this-is-an-internal-example-for-testing-the-cli","errorCode":null,"errorMessage":"This is an internal example for testing the CLI.","messagePattern":"This is an internal example for testing the CLI\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/create-next-app/helpers/examples.ts","lineNumber":134,"sourceCode":"        // This avoids the condition when the repository has been renamed, and the old repository name is used to fetch the example.\n        // The tar download will work as it is redirected automatically, but the root directory of the extracted\n        // example will be the new, renamed name instead of the name used to fetch the example, breaking the filter.\n        if (rootPath === null) {\n          const pathSegments = posixPath.split(posix.sep)\n          rootPath = pathSegments.length ? pathSegments[0] : null\n        }\n\n        return posixPath.startsWith(\n          `${rootPath}${filePath ? `/${filePath}/` : '/'}`\n        )\n      },\n    })\n  )\n}\n\nexport async function downloadAndExtractExample(root: string, name: string) {\n  if (name === '__internal-testing-retry') {\n    throw new Error('This is an internal example for testing the CLI.')\n  }\n\n  await pipeline(\n    await downloadTarStream(\n      'https://codeload.github.com/vercel/next.js/tar.gz/canary'\n    ),\n    x({\n      cwd: root,\n      strip: 2 + name.split('/').length,\n      filter: (p) => p.includes(`next.js-canary/examples/${name}/`),\n    })\n  )\n}\n","sourceCodeStart":116,"sourceCodeEnd":148,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/create-next-app/helpers/examples.ts#L116-L148","documentation":"create-next-app's `downloadAndExtractExample` explicitly rejects the sentinel name `__internal-testing-retry` with this message. That name is a reserved fixture used by CNA's own test suite to exercise the retry/error path; it is not a real example, so attempting to scaffold it is blocked to prevent the downloader from trying to fetch a non-existent example folder.","triggerScenarios":"Running `create-next-app --example __internal-testing-retry ...` (or passing that exact string programmatically). Any other example name proceeds normally.","commonSituations":"Curiosity/testing the CLI with the internal fixture name; copy-pasting from a test file; tooling that enumerates example names accidentally including the sentinel.","solutions":["Choose a real example name from https://github.com/vercel/next.js/tree/canary/examples (e.g. `--example with-typescript`).","If you were testing the CLI error path, use the sentinel intentionally and expect this message.","If automating example listing, filter out `__internal-testing-retry` from the offered names."],"exampleFix":"# before\nnpx create-next-app --example __internal-testing-retry my-app\n\n# after\nnpx create-next-app --example with-typescript my-app","handlingStrategy":"validation","validationCode":"const RESERVED = new Set(['__internal-testing-retry'])\nif (RESERVED.has(exampleName)) {\n  throw new Error(`'${exampleName}' is a reserved internal fixture; choose a real example.`)\n}","typeGuard":"function isReservedExampleName(name: string): boolean {\n  return name === '__internal-testing-retry'\n}","tryCatchPattern":null,"preventionTips":["Filter reserved names when enumerating examples.","Document that __internal-testing-retry is not a real example.","Use a real example name from the examples directory."],"tags":["create-next-app","examples","reserved-name","testing"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}