jackwener/OpenCLI · error · EmptyResultError

notebooklm generate-slides

Error message

notebooklm generate-slides

What it means

This EmptyResultError is thrown by `notebooklm generate-slides` when the notebook is open but no usable source ids were found via the sources-list RPC. Slide-deck generation requires at least one source, so the library stops before invoking the CreateArtifact RPC.

Source

Thrown at clis/notebooklm/generate-slides.js:89

    ],
    columns: ['notebook_id', 'slides_id', 'source_count', 'status', 'notebook_url'],
    func: async (page, kwargs) => {
        const notebookId = parseNotebooklmNotebookTarget(String(kwargs.notebook ?? ''));
        const length = parseSlideDeckLength(kwargs.length);
        const language = String(kwargs.language ?? 'en').trim() || 'en';
        requireNotebooklmExecute(kwargs.execute, 'generate NotebookLM slides');
        try {
            await page.goto(buildNotebooklmNotebookUrl(notebookId));
            await page.wait(2);
        }
        catch (error) {
            throw new CommandExecutionError(`Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}`);
        }
        await requireNotebooklmSession(page);
        const sources = await listNotebooklmSourcesViaRpc(page);
        const sourceIds = sources.map((s) => s.id).filter((id) => typeof id === 'string' && id);
        if (sourceIds.length === 0) {
            throw new EmptyResultError('notebooklm generate-slides', 'The notebook has no sources; add a source before generating a slide deck.');
        }
        const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_CREATE_ARTIFACT_RPC_ID, buildCreateSlidesArgs(notebookId, sourceIds, { length, language }));
        const slidesId = parseSlidesIdFromResult(rpc.result, [notebookId, ...sourceIds]);
        if (!slidesId) {
            throw new CommandExecutionError('NotebookLM CreateArtifact (slides) RPC returned no slide-deck id; the server may have rejected the request.');
        }
        return [{
            notebook_id: notebookId,
            slides_id: slidesId,
            source_count: sourceIds.length,
            status: 'pending',
            notebook_url: buildNotebooklmNotebookUrl(notebookId),
        }];
    },
});

export const __test__ = { SLIDE_DECK_CONFIG_BLOCK, buildCreateSlidesArgs, parseSlideDeckLength, parseSlidesIdFromResult };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Add at least one source to the notebook, then re-run generate-slides.
  2. Wait for pending sources to finish processing and retry.
  3. If sources exist but ids are still empty, re-open the notebook (`notebooklm open`) to refresh the session page.

Example fix

// before
opencli notebooklm generate-slides --notebook empty-notebook
// after
opencli notebooklm add-source --notebook id --url https://example.com/doc
opencli notebooklm generate-slides --notebook id --length 3
Defensive patterns

Strategy: validation

Validate before calling

const sources = await runCli(['notebooklm', 'sources', '--notebook', notebookId]);
if (!sources.length) throw new Error('notebook has no sources; add one before generating slides');

Type guard

const hasSources = (sources) => Array.isArray(sources) && sources.some((s) => typeof s?.id === 'string' && s.id);

Try / catch

try {
  await generateSlides({ notebookId, length });
} catch (e) {
  if (String(e.message).includes('notebooklm generate-slides') && String(e.message).includes('no sources')) {
    throw new Error('Precondition failed: add sources to the notebook first');
  }
  throw e;
}

Prevention

When it happens

Trigger: Running generate-slides against a notebook with zero sources, or the sources RPC returns rows whose ids are missing/non-string and get filtered out.

Common situations: Brand-new empty notebook; sources still uploading/processing so ids are not yet listed; RPC listing silently failing.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/88b029fe751b3309. Report an issue: GitHub.