{"record":{"id":"88b029fe751b3309","repo":"jackwener/OpenCLI","slug":"notebooklm-generate-slides","errorCode":null,"errorMessage":"notebooklm generate-slides","messagePattern":"notebooklm generate-slides","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/generate-slides.js","lineNumber":89,"sourceCode":"    ],\n    columns: ['notebook_id', 'slides_id', 'source_count', 'status', 'notebook_url'],\n    func: async (page, kwargs) => {\n        const notebookId = parseNotebooklmNotebookTarget(String(kwargs.notebook ?? ''));\n        const length = parseSlideDeckLength(kwargs.length);\n        const language = String(kwargs.language ?? 'en').trim() || 'en';\n        requireNotebooklmExecute(kwargs.execute, 'generate NotebookLM slides');\n        try {\n            await page.goto(buildNotebooklmNotebookUrl(notebookId));\n            await page.wait(2);\n        }\n        catch (error) {\n            throw new CommandExecutionError(`Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}`);\n        }\n        await requireNotebooklmSession(page);\n        const sources = await listNotebooklmSourcesViaRpc(page);\n        const sourceIds = sources.map((s) => s.id).filter((id) => typeof id === 'string' && id);\n        if (sourceIds.length === 0) {\n            throw new EmptyResultError('notebooklm generate-slides', 'The notebook has no sources; add a source before generating a slide deck.');\n        }\n        const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_CREATE_ARTIFACT_RPC_ID, buildCreateSlidesArgs(notebookId, sourceIds, { length, language }));\n        const slidesId = parseSlidesIdFromResult(rpc.result, [notebookId, ...sourceIds]);\n        if (!slidesId) {\n            throw new CommandExecutionError('NotebookLM CreateArtifact (slides) RPC returned no slide-deck id; the server may have rejected the request.');\n        }\n        return [{\n            notebook_id: notebookId,\n            slides_id: slidesId,\n            source_count: sourceIds.length,\n            status: 'pending',\n            notebook_url: buildNotebooklmNotebookUrl(notebookId),\n        }];\n    },\n});\n\nexport const __test__ = { SLIDE_DECK_CONFIG_BLOCK, buildCreateSlidesArgs, parseSlideDeckLength, parseSlidesIdFromResult };\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/generate-slides.js#L71-L107","documentation":"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.","triggerScenarios":"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.","commonSituations":"Brand-new empty notebook; sources still uploading/processing so ids are not yet listed; RPC listing silently failing.","solutions":["Add at least one source to the notebook, then re-run generate-slides.","Wait for pending sources to finish processing and retry.","If sources exist but ids are still empty, re-open the notebook (`notebooklm open`) to refresh the session page."],"exampleFix":"// before\nopencli notebooklm generate-slides --notebook empty-notebook\n// after\nopencli notebooklm add-source --notebook id --url https://example.com/doc\nopencli notebooklm generate-slides --notebook id --length 3","handlingStrategy":"validation","validationCode":"const sources = await runCli(['notebooklm', 'sources', '--notebook', notebookId]);\nif (!sources.length) throw new Error('notebook has no sources; add one before generating slides');","typeGuard":"const hasSources = (sources) => Array.isArray(sources) && sources.some((s) => typeof s?.id === 'string' && s.id);","tryCatchPattern":"try {\n  await generateSlides({ notebookId, length });\n} catch (e) {\n  if (String(e.message).includes('notebooklm generate-slides') && String(e.message).includes('no sources')) {\n    throw new Error('Precondition failed: add sources to the notebook first');\n  }\n  throw e;\n}","preventionTips":["Verify sources exist before slide generation.","Wait for pending uploads to finish processing.","Chain add-source -> generate-slides in pipeline scripts."],"tags":["notebooklm","empty-result","precondition","slides"],"backgroundTag":"notebook-has-no-sources","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}