{"record":{"id":"6aa795c5a20e821d","repo":"jackwener/OpenCLI","slug":"no-notebooklm-sources-were-found-on-the-current-pa-6aa795","errorCode":null,"errorMessage":"No NotebookLM sources were found on the current page.","messagePattern":"No NotebookLM sources were found on the current page\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/source-guide.js","lineNumber":32,"sourceCode":"    args: [\n        {\n            name: 'source',\n            positional: true,\n            required: true,\n            help: 'Source id or title from the current notebook',\n        },\n    ],\n    columns: ['source_id', 'notebook_id', 'title', 'type', 'summary', 'keywords', 'source'],\n    func: async (page, kwargs) => {\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new EmptyResultError('opencli notebooklm source-guide', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);\n        const rows = rpcRows.length > 0 ? rpcRows : await listNotebooklmSourcesFromPage(page);\n        if (rows.length === 0) {\n            throw new EmptyResultError('opencli notebooklm source-guide', 'No NotebookLM sources were found on the current page.');\n        }\n        const query = typeof kwargs.source === 'string' ? kwargs.source : String(kwargs.source ?? '');\n        const matched = findNotebooklmSourceRow(rows, query);\n        if (!matched) {\n            throw new EmptyResultError('opencli notebooklm source-guide', `Source \"${query}\" was not found in the current notebook.`);\n        }\n        const guide = await getNotebooklmSourceGuideViaRpc(page, matched).catch(() => null);\n        if (guide)\n            return [guide];\n        throw new EmptyResultError('opencli notebooklm source-guide', `NotebookLM guide was not available for source \"${matched.title}\".`);\n    },\n});\n","sourceCodeStart":14,"sourceCodeEnd":45,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/source-guide.js#L14-L45","documentation":"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.","triggerScenarios":"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.","commonSituations":"New notebook with no sources uploaded yet; slow render timing causing both strategies to see nothing; adapter selectors broken after a NotebookLM frontend update.","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."],"exampleFix":"// before\nopencli notebooklm source-guide --source \"faq\"   # notebook has no sources\n// after\nopencli notebooklm add-source \"faq.md\"\nopencli notebooklm source-guide --source \"faq\"","handlingStrategy":"validation","validationCode":"const sources = await exec('opencli notebooklm source-list --json');\nif (!Array.isArray(sources) || sources.length === 0) throw new Error('Notebook empty or sources not loaded; add a source or reopen');","typeGuard":"function hasSources(rows) {\n  return Array.isArray(rows) && rows.length > 0 && typeof rows[0]?.id === 'string';\n}","tryCatchPattern":"try {\n  return await run('opencli notebooklm source-guide', ['--source', name]);\n} catch (err) {\n  if (/No NotebookLM sources were found/.test(err.message)) {\n    await run('opencli notebooklm open', [notebook]);\n    await delay(2000);\n    return run('opencli notebooklm source-guide', ['--source', name]);\n  }\n  throw err;\n}","preventionTips":["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."],"tags":["notebooklm","empty-result","browser-scraping"],"backgroundTag":"notebooklm-empty-source-list","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}