Protocol error (Runtime.callFunctionOn): Object is not serializable
Categories
(Remote Protocol :: CDP, defect, P3)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
References
Details
This is from Puppeteer unit tests like 'window.open should use parent tab context' in browsercontext.spec.js. Overall I can see it 16 times in the test log:
Protocol error (Runtime.callFunctionOn): Object is not serializable _serialize@chrome://remote/content/domains/content/runtime/ExecutionContext.jsm:265:13
callFunctionOn@chrome://remote/content/domains/content/runtime/ExecutionContext.jsm:191:23
callFunctionOn@chrome://remote/content/domains/content/Runtime.jsm:176:20
execute@chrome://remote/content/domains/DomainCache.jsm:99:25
receiveMessage@chrome://remote/content/sessions/ContentProcessSession.jsm:69:45
MessageListener.receiveMessage*ContentProcessSession@chrome://remote/content/sessions/ContentProcessSession.jsm:27:25
@chrome://remote/content/sessions/frame-script.js:12:1
In the above case the failure happens when calling the method like:
puppeteer:protocol SEND ► {"sessionId":1,"method":"Runtime.callFunctionOn","params":{"functionDeclaration":"url => window.open(url)\n//# sourceURL=__puppeteer_evaluation_script__\n","executionContextId":3,"arguments":[{"value":"http://localhost:8907/empty.html"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":19}
Running the same with Chrome I get:
puppeteer:protocol ◀ RECV {"error":{"code":-32000,"message":"Object reference chain is too long"},"id":19,"sessionId":"7E8ADE5DF74F17AA5095DE11FF5E7511"} +0ms
When I run other tests like for BigInt also Chrome fails but with a clear message:
Unsupported unserializable value: 42n
Looks like we miss a sane fallback value.
| Reporter | ||
Comment 1•6 years ago
|
||
Here the details for the last example which doesn't raise an error:
puppeteer:protocol SEND ► {"sessionId":"40B6E738F1032A86F4AE98F22629F9DE","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"() => BigInt(42)\n//# sourceURL=__puppeteer_evaluation_script__\n","executionContextId":1,"arguments":[],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":18} +1ms
puppeteer:protocol ◀ RECV {"id":18,"result":{"result":{"type":"bigint","unserializableValue":"42n","description":"42n"}},"sessionId":"40B6E738F1032A86F4AE98F22629F9DE"} +8ms
| Reporter | ||
Comment 2•6 years ago
|
||
Raising an error on purpose seem to be the wrong way:
| Reporter | ||
Comment 3•6 years ago
|
||
Interesting is that even Chrome is not using the exceptionDetails property of the returned value to indicate that there was a problem in serializing the value. Andrey, could you have a look if that is expected? I would assume this only happens with silent = true?
| Assignee | ||
Updated•5 years ago
|
Comment 4•4 years ago
|
||
Clear a needinfo that is pending on an inactive user.
For more information, please visit auto_nag documentation.
| Reporter | ||
Comment 5•4 years ago
|
||
If we would ever get to this bug the implementation might look similarly to the one for WebDriver BiDi (bug 1770489).
Updated•3 years ago
|
| Reporter | ||
Comment 6•2 years ago
|
||
We are not going to fix this API for CDP.
Description
•