Skip to content

MCP Server crashes when a simple button is clicked #524

Closed
microsoft/playwright
#36214
@amigold

Description

@amigold

elementHandlerDispatcher.js:49
throw new Error("ElementHandle can only be created from FrameDispatcher");
^

Error: ElementHandle can only be created from FrameDispatcher
at ElementHandleDispatcher.fromJSHandle (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js:49:13)
at /Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js:101:99
at Array.map ()
at WKBrowserContext. (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js:101:32)
at WKBrowserContext.emit (node:events:519:28)
at Page.emitOnContextOnceInitialized (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/page.js:151:27)
at Page.addConsoleMessage (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/page.js:253:10)
at WKPage._onConsoleRepeatCountUpdated (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/webkit/wkPage.js:526:20)
at WKPage._onConsoleMessage (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/webkit/wkPage.js:514:10)
at WKSession. (/Users/amigoldenberg/.npm/_npx/9833c18b2d85bc59/node_modules/playwright-core/lib/server/webkit/wkPage.js:350:112)

Node.js v21.7.3
2025-06-05T07:53:54.137Z [playwright] [info] Server transport closed
2025-06-05T07:53:54.137Z [playwright] [info] Client transport closed
2025-06-05T07:53:54.137Z [playwright] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. console.error('...') in JavaScript, print('...', file=sys.stderr) in python) and it will appear in this log.
2025-06-05T07:53:54.137Z [playwright] [error] Server disconnected. For troubleshooting guidance, please visit our debugging documentation {"context":"connection"}
2025-06-05T07:53:54.137Z [playwright] [info] Client transport closed

Activity

Skn0tt

Skn0tt commented on Jun 5, 2025

@Skn0tt
Member

Hi! Could you share the chat trajectory that led to this? What website did this happen on? Also, what's your config besides using Webkit as your browser?

amigold

amigold commented on Jun 5, 2025

@amigold
Author

There you go @Skn0tt thank you for the swift response!

Image

Image

Image

Skn0tt

Skn0tt commented on Jun 5, 2025

@Skn0tt
Member

Thanks! Looks like microsoft/playwright#36214 will fix it.

What's that "Ran Preview" tool you're using?

amigold

amigold commented on Jun 5, 2025

@amigold
Author

oh great thanks @Skn0tt I'll listen for an update

its just a Windsurf tool

giovaborgogno

giovaborgogno commented on Jun 6, 2025

@giovaborgogno

I saw that the fix was merged in microsoft/playwright#36214, Is it included in playwright 1.53.0-alpha-2025-05-27?

"playwright": "1.53.0-alpha-2025-05-27",

Manouchehri

Manouchehri commented on Jun 10, 2025

@Manouchehri

@giovaborgogno I don't think so, since I'm still facing this issue on 0.0.28.

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

      Participants

      @pavelfeldman@amigold@Manouchehri@Skn0tt@giovaborgogno

      Issue actions

        MCP Server crashes when a simple button is clicked · Issue #524 · microsoft/playwright-mcp