With latest version of Codeceptjs and puppeteer, we are experiencing extreme slow performance, I was wondering if there is a recommended version for codeceptjs and puppeteer.
Out of curiosity, could you provide more insights of the degradation of the execution. I see the tests in GHA is not that slow.
OK | 33 passed, 1 skipped // 27s
Hi @peterngtr thanks for the reply,
when initializing test I would see the following;
Degraded performance warning: Launching Chrome on Mac Silicon (arm64) from an x64 Node installation results in Rosetta translating the Chrome binary, even if Chrome is already arm64. This would result in huge performance issues. To resolve this, you must run Puppeteer with a version of Node built for arm64.
Also in some input field action such as fillField or clear, I would get the following error;
“JSHandles can be evaluated only in the context they were created!”
My node version is: v21.7.1
Npm version is: 10.5.0
Any suggestion would greatly be appreciated.
-Thanks
I remembered I got the same issue on MacOS, so to tackle the issue, I followed those steps:
Mac OS
Here is my working solution using puppeteer’s native chromium instead of installing your own:
- Uninstall puppeteer
- Open native terminal
- cd repo
- enter
arch
and see if it returns arm64 - enter
nvm install stable
- enter
nvm use stable
- verify installation by entering
node -e 'console.log(process.arch)'
and see if it returns arm64 - enter
npm i puppeteer
- enter
node node_modules/puppeteer/install.mjs
(ornode node_modules/puppeteer/install.js
– depending on your node modules) - it should work