{"record":{"id":"d63e8b3a3d76ceaf","repo":"jackwener/OpenCLI","slug":"no-notebooklm-sources-were-found-on-the-current-pa-d63e8b","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-get.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: ['title', 'id', 'type', 'size', 'created_at', 'updated_at', 'url', '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-get', '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-get', '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            return [matched];\n        throw new EmptyResultError('opencli notebooklm source-get', `Source \"${query}\" was not found in the current notebook.`);\n    },\n});\n","sourceCodeStart":14,"sourceCodeEnd":41,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/source-get.js#L14-L41","documentation":"opencli notebooklm source-get throws this EmptyResultError when a valid notebook page is open but neither the internal RPC listing nor DOM scraping found any source rows. It guards against proceeding with an empty source list that could never match the user's query.","triggerScenarios":"Calling source-get on a newly created notebook with zero sources, on a notebook whose source list failed to load (slow network, UI still rendering), or when both listNotebooklmSourcesViaRpc and listNotebooklmSourcesFromPage return empty arrays.","commonSituations":"Brand-new notebook with no uploads yet; NotebookLM UI changed so DOM selectors and RPC parsing both fail; page was captured mid-load before sources rendered; sync issues between Google services.","solutions":["Add at least one source to the notebook (via `opencli notebooklm add-source` or the NotebookLM web UI).","Reload the notebook (`opencli notebooklm open <notebook>` again) and retry so the source list finishes loading.","Retry after a short delay if the page was still rendering; if it persists, the adapter may need updating for a NotebookLM UI change."],"exampleFix":"// before\nopencli notebooklm source-get --source \"notes\"   # empty notebook\n// after\nopencli notebooklm add-source \"notes.md\"\nopencli notebooklm source-get --source \"notes\"","handlingStrategy":"validation","validationCode":"const sources = await exec('opencli notebooklm source-list --json');\nif (!Array.isArray(sources) || sources.length === 0) throw new Error('Notebook has no sources; add one before source-get');","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-get', ['--source', name]);\n} catch (err) {\n  if (/No NotebookLM sources were found/.test(err.message)) {\n    await run('opencli notebooklm add-source', [file]);\n    return run('opencli notebooklm source-get', ['--source', name]);\n  }\n  throw err;\n}","preventionTips":["Verify the notebook is non-empty with source-list before querying sources.","Reopen the notebook and wait for the UI to render before scraping-heavy commands.","Add sources programmatically before dependent lookups in CI pipelines.","Watch for repeated failures on non-empty notebooks — a sign the adapter needs updating."],"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"}