Issue
To simulate an error I rarely get but cannot reproduce in Puppeteer ^17.1.3, I inserted a throw at the exact same place:
PS C:\Users\User\Documents\project> node testingScript.js
C:\Users\User\Documents\project\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:124
throw new Error("Missing frame isMainFrame=false, frameId=3427AF206D1A9A044F89F086F2CB9AB6")
^
Error: Missing frame isMainFrame=false, frameId=3427AF206D1A9A044F89F086F2CB9AB6
at Connection.onMessage (C:\Users\User\Documents\project\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:124:15)
at WebSocket.<anonymous> (C:\Users\User\Documents\project\node_modules\puppeteer\lib\cjs\puppeteer\node\NodeWebSocketTransport.js:45:32)
at WebSocket.onMessage (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\websocket.js:1178:20)
at Receiver.emit (node:events:390:28)
at Receiver.dataMessage (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\receiver.js:528:14)
at Receiver.getData (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\receiver.js:446:17)
at Receiver.startLoop (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\receiver.js:148:22)
at Receiver._write (C:\Users\User\Documents\project\node_modules\puppeteer\node_modules\ws\lib\receiver.js:83:10)
No matter what I try, I cannot seem to catch this error. How can I do that?
const puppeteer = require('puppeteer');
(async () => {
try{
browser = await puppeteer.launch().catch((err) => {
console.log ("Error1: ", err)
});
} catch(e){
console.log("Error2: "+e)
}
})().catch((err) => {
console.log ("Error3: ", err)
});;
Solution
Starting from puppeteer 18 the assertion is no longer there according to the developers, an update fixes the issue.
Answered By - herecy Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.