Skip to content

[bug] Claude Code API Error After Screenshot of Large Page #817

Closed

Description

After taking a screenshot with full page for a long page, claude code is unable to handle the large image due to exceeding the max image dimensions (8000 pixels).

⏺ playwright - Take a screenshot (MCP)(filename: "homepage.png", fullPage: true)
  ⎿  ### Result
     Took the full page screenshot and saved it as /tmp/playwright-mcp-output/2025-08-01T00-37-01.779Z/homepage.png

     ### Ran Playwright code
     ```js
     // Screenshot full page and save it as /tmp/playwright-mcp-output/2025-08-02T00-37-01.779Z/homepage.png
     await page.screenshot({
       fullPage: true,
       path: '/tmp/playwright-mcp-output/2025-08-01T00-37-01.779Z/homepage.png',
       quality: 50,
       scale: 'css',
       type: 'jpeg'
     });
     ```

  ⎿  [Image]

17:41
  ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.5.image.source.base64.data: At least one of the image dimensions exceed
    max allowed size: 8000 pixels"}}

Activity

  1. pavelfeldman commented on Aug 2, 2025

    @pavelfeldman
    Member

    Did you ask it to take a full page screenshot or did it do it on its own?

  2. ColeMurray commented on Aug 3, 2025

    @ColeMurray
    Author

    on its own

  3. pavelfeldman commented on Aug 4, 2025

    @pavelfeldman
    Member

    Could you share more on the context / prompt? Feedback is split over this so we need more information to tune it right.

  4. lbguilherme commented on Aug 5, 2025

    @lbguilherme

    I also have the same problem. Claude Code decides on its own to take a fullPage screenshot and then breaks down with a imagem too large to fit in the context.

    ✻ Thinking…
    
      Agora vou tirar um screenshot para ver como ficou com os espaçamentos reduzidos.
    
    ⏺ playwright - Take a screenshot (MCP)(filename: "[redacted].png", fullPage: true)
      ⎿ ### Result
        Took the full page screenshot and saved it as /var/folders/63/h9mgyy0n6rldc0kdv_7v_s6w0000gn/T/playwright-mcp-
        output/2025-08-05T10-19-36.716Z/[redacted].png
        … +14 lines (ctrl+r to expand)
    
      ⎿  [Image]
      ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.15.content.23.image
        .source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels"}}
    

    They currently have a bug (anthropics/claude-code#2752) where this causes the session to be unrecoverable. The only way is to start a new session (/clear) or backtrack to a previous message (esc esc).

    Anyway, I believe Playwright MCP should impose some maximum size on the image output, maybe as a configurable CLI flag or environment variable. Or maybe even disabling full page screenshots as an option.

  5. ItisDL commented on Aug 21, 2025

    @ItisDL

    i think need a param to deal that,this fix influence me,i need fullpage and base64
    TKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions