diff --git a/experimental/puppeteer-firefox/lib/ExecutionContext.js b/experimental/puppeteer-firefox/lib/ExecutionContext.js index d74c12fc2e5..26ccb7b2dfd 100644 --- a/experimental/puppeteer-firefox/lib/ExecutionContext.js +++ b/experimental/puppeteer-firefox/lib/ExecutionContext.js @@ -67,7 +67,7 @@ class ExecutionContext { executionContextId: this._executionContextId }); } catch (err) { - if (err instanceof TypeError && err.message === 'Converting circular structure to JSON') + if (err instanceof TypeError && err.message.startsWith('Converting circular structure to JSON')) err.message += ' Are you passing a nested JSHandle?'; throw err; } diff --git a/lib/ExecutionContext.js b/lib/ExecutionContext.js index 9a4ac6236b7..cda3899d1ee 100644 --- a/lib/ExecutionContext.js +++ b/lib/ExecutionContext.js @@ -113,7 +113,7 @@ class ExecutionContext { userGesture: true }); } catch (err) { - if (err instanceof TypeError && err.message === 'Converting circular structure to JSON') + if (err instanceof TypeError && err.message.startsWith('Converting circular structure to JSON')) err.message += ' Are you passing a nested JSHandle?'; throw err; }