slidevjs/slidev · error · Error

No active slide entry found. Please set an active slide entr

Error message

No active slide entry found. Please set an active slide entry before using this tool.

What it means

Thrown by `resolveProjectFromEntry` (shared by most Slidev LM tools) when the entry is the sentinel `''` or `'$ACTIVE_SLIDE_ENTRY'` but no active entry has been set yet (`activeEntry.value` is falsy). These sentinels mean 'use whatever the user last chose'; if nothing was chosen, resolution cannot proceed.

Source

Thrown at packages/vscode/src/lmTools.ts:115

      try {
        const result = invoke(input)
        return new LanguageModelToolResult([
          new LanguageModelTextPart(result),
        ])
      }
      catch (error: any) {
        return new LanguageModelToolResult([
          new LanguageModelTextPart(`Error: ${error.message || error.toString()}`),
        ])
      }
    },
  }))
}

function resolveProjectFromEntry(entry: string) {
  if (entry === '' || entry === '$ACTIVE_SLIDE_ENTRY') {
    if (!activeEntry.value) {
      throw new Error('No active slide entry found. Please set an active slide entry before using this tool.')
    }
    entry = activeEntry.value
  }

  let project = projects.get(entry)
  if (!project) {
    entry = slash(entry)
    const possibleProjects = [...projects.values()].filter(p => p.entry.includes(entry))
    if (possibleProjects.length === 0) {
      throw new Error(`No project found for entry: ${entry}. All entries: ${formatList(projects.keys())}`)
    }
    else if (possibleProjects.length > 1) {
      throw new Error(`Multiple projects found for entry: ${entry}. Please specify the full path. All entries: ${formatList(projects.keys())}`)
    }
    else {
      project = possibleProjects[0]
    }
  }

View on GitHub (pinned to 0d798ace58)

Solutions

  1. Call `slidev_chooseEntry` with a concrete entry path first to populate `activeEntry`, then retry the original tool.
  2. Alternatively, pass an explicit `entrySlidePath` to the tool instead of relying on `$ACTIVE_SLIDE_ENTRY`.
  3. Use `slidev_listEntries` to discover a valid entry path if you don't know one.

Example fix

// before: relying on the active sentinel before one is set
{ entrySlidePath: '$ACTIVE_SLIDE_ENTRY', slideNo: 1 } // throws [47]
// after: establish the active entry first
// step 1: slidev_chooseEntry { entrySlidePath: '/abs/slides.md' }
// step 2: slidev_getSlideContent { entrySlidePath: '$ACTIVE_SLIDE_ENTRY', slideNo: 1 }
Defensive patterns

Strategy: validation

Validate before calling

// Before calling any tool with '$ACTIVE_SLIDE_ENTRY' or '', ensure one is set:
import { activeEntry } from './projects'
function hasActiveEntry(): boolean {
  return Boolean(activeEntry.value)
}
// if false, call slidev_chooseEntry first, or pass an explicit entrySlidePath.

Type guard

function activeEntryIsSet(): boolean {
  return activeEntry.value != null && activeEntry.value !== ''
}

Prevention

When it happens

Trigger: Any tool that calls `resolveProjectFromEntry` receives an empty string or `$ACTIVE_SLIDE_ENTRY` (e.g. the model omits a concrete path and relies on the default), but `activeEntry` was never populated because `slidev_chooseEntry` was not called successfully.

Common situations: The model calls `slidev_getSlideContent` / `slidev_findSlideNoByTitle` / etc. without first establishing which deck is active; the user opened a deck but never ran `chooseEntry`; the extension was reloaded and `activeEntry` reset to empty.

Related errors


AI-assisted analysis of slidevjs/slidev@0d798ace58 (2026-08-12). Data as JSON: /api/errors/bc63aa69b3e77990. Report an issue: GitHub.