jackwener/OpenCLI · error · EmptyResultError
No NotebookLM sources were found on the current page.
Error message
No NotebookLM sources were found on the current page.
What it means
opencli notebooklm source-guide throws this EmptyResultError when a notebook is open but the combined RPC + DOM listing found zero sources, so there is nothing to match the --source query against. Thrown before any guide generation is attempted.
Source
Thrown at clis/notebooklm/source-guide.js:32
args: [
{
name: 'source',
positional: true,
required: true,
help: 'Source id or title from the current notebook',
},
],
columns: ['source_id', 'notebook_id', 'title', 'type', 'summary', 'keywords', 'source'],
func: async (page, kwargs) => {
await requireNotebooklmSession(page);
const state = await getNotebooklmPageState(page);
if (state.kind !== 'notebook') {
throw new EmptyResultError('opencli notebooklm source-guide', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');
}
const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);
const rows = rpcRows.length > 0 ? rpcRows : await listNotebooklmSourcesFromPage(page);
if (rows.length === 0) {
throw new EmptyResultError('opencli notebooklm source-guide', 'No NotebookLM sources were found on the current page.');
}
const query = typeof kwargs.source === 'string' ? kwargs.source : String(kwargs.source ?? '');
const matched = findNotebooklmSourceRow(rows, query);
if (!matched) {
throw new EmptyResultError('opencli notebooklm source-guide', `Source "${query}" was not found in the current notebook.`);
}
const guide = await getNotebooklmSourceGuideViaRpc(page, matched).catch(() => null);
if (guide)
return [guide];
throw new EmptyResultError('opencli notebooklm source-guide', `NotebookLM guide was not available for source "${matched.title}".`);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Add sources to the notebook via `opencli notebooklm add-source` or the web UI.
- Reopen the notebook (`opencli notebooklm open <notebook>`) and retry after the source list renders.
- Retry later or update opencli if NotebookLM's UI changed and both listing strategies fail.
Example fix
// before opencli notebooklm source-guide --source "faq" # notebook has no sources // after opencli notebooklm add-source "faq.md" opencli notebooklm source-guide --source "faq"
Defensive patterns
Strategy: validation
Validate before calling
const sources = await exec('opencli notebooklm source-list --json');
if (!Array.isArray(sources) || sources.length === 0) throw new Error('Notebook empty or sources not loaded; add a source or reopen'); Type guard
function hasSources(rows) {
return Array.isArray(rows) && rows.length > 0 && typeof rows[0]?.id === 'string';
} Try / catch
try {
return await run('opencli notebooklm source-guide', ['--source', name]);
} catch (err) {
if (/No NotebookLM sources were found/.test(err.message)) {
await run('opencli notebooklm open', [notebook]);
await delay(2000);
return run('opencli notebooklm source-guide', ['--source', name]);
}
throw err;
} Prevention
- Check source-list output before requesting guides.
- Reopen the notebook to ensure sources finished loading.
- Add sources before guide-dependent pipeline steps.
- Treat persistent empty listings on a populated notebook as an adapter-version issue.
When it happens
Trigger: source-guide called against an empty notebook, or when listNotebooklmSourcesViaRpc fails (caught to []) and listNotebooklmSourcesFromPage finds no rows, e.g. during page load or after a NotebookLM UI change.
Common situations: New notebook with no sources uploaded yet; slow render timing causing both strategies to see nothing; adapter selectors broken after a NotebookLM frontend update.
Related errors
- No NotebookLM sources were found on the current page.
- No NotebookLM sources were found on the current page.
- opencli notebooklm current
- notebooklm generate-audio
- notebooklm generate-slides
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/6aa795c5a20e821d.
Report an issue: GitHub.