Skip to content

[bug] PDF export silently fails on pip install nao-core (puppeteer-core not bundled) #705

@mktemba

Description

@mktemba

Following the README quickstart (pip install nao-core → nao chat) on a local MacOS device, I created an artifact in a chat and in that artifact clicked Download → PDF, and nothing happens: no download, and no visible error. HTML download from the same menu works fine, so the rest of the route is healthy.

What the backend log shows
[ERROR] tRPC error on story.download: puppeteer-core is not available. PDF export requires puppeteer-core and a Chrome/Chromium installation.
500 on /api/trpc/story.download for format=pdf, 200 for format=html.

What I think is going on (with AI assisted debugging)

The standalone nao-chat-server binary is built with --external puppeteer-core (see build:standalone in apps/backend/package.json), so the npm package isn't inside it. The pip-install path doesn't (and can't) ship a node_modules/puppeteer-core alongside, so import('puppeteer-core') in story-pdf.ts fails before any Chromium check. Docker users don't see this because the Dockerfile runs bun install.

Why I didn't see the error in the UI (Surfaced during AI debugging)

StoryDownloadSubMenu (the side-panel variant in story-header.tsx) pulls useStoryDownload but drops the error field on the floor — no error UI is rendered. The other variant StoryDownload does render it. So the same failure looks like a no-op in the side panel and a visible error elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions