Skip to content

Crash on Windows when pasting images from clipboard (ERR_INVALID_URL_SCHEME) #12547

Closed

Description

@abdiths

Description

Pasting any image from the clipboard on Windows 11 crashes the app.

App throws TypeError: The URL must be of scheme file and the prompt fails. Happens every time an image is pasted from clipboard.

Plugins

none

OpenCode version

0.0.0-dev-202602062314

Steps to reproduce

  1. Run OpenCode on Windows
  2. Open a new session
  3. Paste any image from clipboard into the prompt input

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

No response

Activity

  1. github-actions commented on Feb 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. yxshee commented on Feb 7, 2026

    @yxshee

    #12592

    Fixed crash when pasting images from clipboard on Windows 11.

    Error: TypeError: The URL must be of scheme file (ERR_INVALID_URL_SCHEME)

    Root Cause

    In prompt.ts, the switch statement at line 946 handles URL protocols:

    • case "data:" only processes text/plain mime types, then breaks
    • For clipboard images (image/png), the condition fails and falls through to case "file:"
    • fileURLToPath() is called on a data: URL → crash
  3. github-actions commented on Apr 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions