{"record":{"id":"0472969e3b9faafb","repo":"slidevjs/slidev","slug":"no-project-found-for-entry-entry-all-entries","errorCode":null,"errorMessage":"No project found for entry: ${entry}. All entries: ${formatList(projects.keys())}","messagePattern":"No project found for entry: (.+?)\\. All entries: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vscode/src/lmTools.ts","lineNumber":125,"sourceCode":"      }\n    },\n  }))\n}\n\nfunction resolveProjectFromEntry(entry: string) {\n  if (entry === '' || entry === '$ACTIVE_SLIDE_ENTRY') {\n    if (!activeEntry.value) {\n      throw new Error('No active slide entry found. Please set an active slide entry before using this tool.')\n    }\n    entry = activeEntry.value\n  }\n\n  let project = projects.get(entry)\n  if (!project) {\n    entry = slash(entry)\n    const possibleProjects = [...projects.values()].filter(p => p.entry.includes(entry))\n    if (possibleProjects.length === 0) {\n      throw new Error(`No project found for entry: ${entry}. All entries: ${formatList(projects.keys())}`)\n    }\n    else if (possibleProjects.length > 1) {\n      throw new Error(`Multiple projects found for entry: ${entry}. Please specify the full path. All entries: ${formatList(projects.keys())}`)\n    }\n    else {\n      project = possibleProjects[0]\n    }\n  }\n\n  return project\n}\n\nfunction formatList(items: Iterable<string>): string {\n  const itemsArray = [...items]\n  if (itemsArray.length === 0) {\n    return 'No items found.'\n  }\n  return itemsArray.map(item => `- ${item}\\n`).join('')","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/vscode/src/lmTools.ts#L107-L143","documentation":"Thrown by `resolveProjectFromEntry` when the entry is not a direct key in the `projects` map AND no loaded project's entry path contains the (slash-normalized) input as a substring. The message lists every loaded entry via `formatList(projects.keys())` so the caller can pick a correct one. This is the 'zero matches' branch of the fuzzy fallback.","triggerScenarios":"The model passes an `entrySlidePath` that is a typo, a relative path that doesn't appear as a substring of any loaded entry, a path from a different workspace, or a path with mismatched casing/separators that survives `slash()` normalization but still matches nothing.","commonSituations":"Wrong working directory assumption, the deck file was renamed/moved since the model last saw it, Windows backslash vs POSIX slash mismatches not fully reconciled by `slash()`, or the project was closed/disposed and removed from the `projects` map.","solutions":["Call `slidev_listEntries` and pass one of the returned entry paths verbatim.","Pass the full absolute path to the entry file rather than a short relative fragment.","If the project was closed, reopen the deck / restart the preview so it re-registers in the `projects` map.","Verify the path separators and casing match what `slidev_listEntries` reports."],"exampleFix":"// before: substring matches nothing\n{ entrySlidePath: './deck/slides.md', slideNo: 1 } // throws [48]\n// after: use a path reported by slidev_listEntries\n{ entrySlidePath: '/Users/me/project/deck/slides.md', slideNo: 1 }","handlingStrategy":"validation","validationCode":"// Before calling a tool with an entry fragment, confirm it matches a loaded project:\nimport { slash } from '@antfu/utils'\nimport { projects } from './projects'\nfunction matchesExactlyOneEntry(fragment: string): boolean {\n  const f = slash(fragment)\n  if (projects.has(fragment)) return true\n  const hits = [...projects.values()].filter(p => p.entry.includes(f))\n  return hits.length === 1\n}","typeGuard":"function entryResolves(fragment: string): boolean {\n  const f = slash(fragment)\n  return projects.has(fragment)\n    || [...projects.values()].filter(p => p.entry.includes(f)).length === 1\n}","tryCatchPattern":null,"preventionTips":["Prefer the full absolute entry path returned by `slidev_listEntries`.","Call `slidev_listEntries` whenever an entry path is rejected to see the valid options.","Reopen/re-preview the deck if the project was closed and removed from the map.","Watch for casing/separator differences; `slash()` normalizes backslashes but not case."],"tags":["slidev","vscode","language-model-tools","entry-resolution","path"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}