Cypress verification timed out after 30000 milliseconds - node.js

I am using cypress 5.0 in JS project. When I try to run npx cypress open keep getting error verification timed out after 30000 milliseconds.
Node version: v12.18.2
OS: Windows 7
Cypress : 5.0.0
I have downgraded to Cypress 4.0.0 and downgraded my node too. But keep getting the error. Please find the screenshot below. 2

I had a similar issue and I used the npx cypress verify to carry out the verification.
This happens because there's a verification that's meant to happen for first-time users but for some reason, the verification process times out.so one way to make the verification work is by using the npx cypress verify package.

This issue is not related to Cypress version. To resolve it, you need to increase the default timeout.
Open node_modules\cypress\lib\tasks\verify.js, search for VERIFY_TEST_RUNNER_TIMEOUT_MS and change it from 30000 (default) to 100000.
Save the file, then try to open the runner.

Retrying launching Cypress one more time worked out with the error being gone, hmm...

From Cypress version 9.2.0, you no longer have to change the timeout value in node_modules\cypress\lib\tasks\verify.js file manually.
Instead, you can utilize an environment variable called CYPRESS_VERIFY_TIMEOUT "to override the timeout duration of the verify command". Here is the link to the documentation about cypress verify command that mentions it.
Even better, starting from version 9.3.0, we can set the environment variable in a project's package.json or .npmrc (or .yarnrc) file.
Using this environment variable to increase the timeout (3 minutes for us) was necessary for us to ensure stability in our CI testing pipeline.

It's all due the Cache. Clear the cache it will automatically set.
I got the solution from this article. Follow the last step:
npm cache clean --force
https://softans.com/clear-cache-file-in-cypress/

Rerun it. It will work.
Rerunning it verified the cypress.

I had the same problem, running Cypress in WSL 2 would throw the same error even after trying all the solutions here.
I realised my Xserver was not running, started it up and everything worked again.

Please try this
go to path: node_modules\cypress\lib\tasks\verify.js, and you need to increase the default timeout.
Open verify.js, search for the variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.
Save and try to open the runner. I hope now you will able to run the tests.

To resolve this issue, you need to increase default timeout. For this, go to below path: node_modules\cypress\lib\tasks\verify.js & Open verify.js, search variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.

I also got this error , so I relaunch the cypress again(Which works for me) and also to be on safe side i have change the default duration with 100000s for future.

I just had the same problem, I solved it just by disabling the antivirus [Windows 10].

1st time using this tool today on my CentOS system.
Got the same error when trying to run cypress open and cypress verify.
Tried clearing the cache, reinstalling and all that fun stuff.
Nothing fixed it.
Note: I had VSCode running on my system and I had recently started the Angular ng test to test other tests.
Apparently something with ng test interferes with Cypress. Once I turned off ng test and tried to open and verify Cypress it worked.
Cypress 9.1.1

Problem with Windows was restarting the terminal, probably the PATH was not correctly updated.

Related

Cloud Functions Puppeteer cannot open browser

My setup in GCF:
install npm install --save puppeteer from project cloud shell
edit package.json like so:
{ "dependencies": { "puppeteer": "^19.2.2" } }
paste code from medium.com into index.js:
https://gist.githubusercontent.com/Alezco/b9b7ce4ec7ee7f208818e395225fcbbe/raw/8554acc8b311a10e272f5d1b98dce3400945bb00/index.js
deploy with 2 GB RAM, 0-3 instances, max 500s timeout
I get these errors after building or opening the URL:
Internal Server Error
Could not find Chromium (rev. 1056772). This can occur if either 1. you did not perform an installation before running the script (e.g. npm install) or 2. your cache path is incorrectly configured (which is: /workspace/.cache/puppeteer). For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
When I run npm list both webdriver and puppeteer are installed. I suspect there is an issue this Path but I cannot figure out where it should lead.
I could then provide puppeteer.launch() with argument executablePath which might solve the problem.
I tried reinstalling puppeteer and changing configuration. No luck.
In addition to adding a .puppeteerrc.cjs per Kristofer's answer, I added a postinstall script in my package.json:
"scripts": {
...
"postinstall": "node node_modules/puppeteer/install.js"
},
This fixed the problem and I was able to deploy my Google Cloud Function. This is a temporary fix until issue #9128 is fixed.
I had the exact same issue and it seems to be related to this https://github.com/puppeteer/puppeteer/issues/9128
I'm using Firebase and don't have complete control over the build process when I deploy my functions but I still have access to the build logs. From the issue above, I realized I needed to handle the cache directory and the NPM version for this to work.
As far as I can tell the problem is that the build step installs the Chrome browser needed for Puppeteer in a cache directory outside of the final image that is used for the actuall function. In that context the error message makes more sence, it can't find the browser therefor it doesn't work.
I was using Node 14 in my cloud functions which used NPM 6.14.17 in the build steps. According to the issue you need to use NPM > 7 so I upgraded my function to use Node 16.
Then I added the .puppeteerrc.cjs from https://pptr.dev/guides/configuration/#examples when testing that locally it will add a .cache directory where the Chrome installation is. This has to be ignored when deploying the cloud function or the deplot will fail due to size.
In the firebase.json add:
"functions": {
"ignore": [
".cache"
]
},
The last step is pretty specific for Firebase and I'm not sure how this applies to your build steps etc. But this solved my issue that had the exact same error messages as you had. So double check the following:
NPM version in the build step, needs to beat least v.7 - Node 16 should do this.
Cache directory specified in the .puppeteerrc.cjs
It also looks like your using an old Puppeteer version, I used 19.3
I got this same (very missleading) error in my Puppeteer project which I run in Google Cloud Function. The issue was that Function was finishing (exiting) before the async Puppeteer script was finished.
Resolved this issue by changing the "await browser.close();" to a Promise and creating the response message in promise.then().
... only to hit next problem. My script is not downloading the csv file as expected. Works locally though...

cypress cache clear hanging

For context I am working in windows 10 with Node.js.
Having set up cypress successfully after a load of trial and error in one project file I am starting from scratch with another project file to work out the exact steps.
For some reason it is failing with the new attempt and having noticed the errors show v 7/3/0 whereas the errors for the previous showed v 7.2.0 I thought I'd return to the first project file and try
cypress clear cache as recommended at docs.cypress.io/guides/references/troubleshooting which I've assumed that was to be run at the Node.js command prompt.
Having done so Node.js is just hanging.
Is this expected behaviour?
Have I misunderstood the instructions?
Thanks

Why does PM2 work on one server, but not on another?

We have two instances of our Node-Express app: one for development, and one for production. We are implementing PM2 process manager. This is for a Windows Server 2012 environment.
For some baffling reason, PM2 (with pm2-windows-service) worked fine when set up in our dev environment, but won't even run node in our Prod environment. What could be the cause?
Log files reveal nothing helpful
If you look at my related question, you can see that PM2 appears to be launching node, but is not (or it instantly crashes).
All we can conclude is there is some difference in settings between these two servers. Any clue what difference in settings might be causing PM2 to fail like this?
This is related to a more specific question I have out there about issues we're having implementing PM2.
Thank you!
Ok, I got the answer after posting an issue to the pm2 github issues page.
Sharing it here in case anyone else finds themselves in this situation:
https://github.com/Unitech/pm2/issues/4113
(basically pm2 3.2.5 introduced a bug that causes this issue in Windows. My QA install was 3.2.4. The issue was resolved by reverting to 3.2.4. Simple process, see instructions at link above.)
It may be not really pm2 issue, bit more npm. On the server where pm2 doesn't work please try that command in PowerShell:
Get-Command pm2
Does it return the correct version(not 0.0.0)? If not, there is an issue diring installing that package, so as an option it's possible to install that manually. Also we asked familiar question in that ticket last month:
https://github.com/Unitech/pm2/issues/3964
Like it described in a ticket above you can try to check other npm package with familiar issues:
npm install mocha -g
And that try to reach mocha-cli

Issues running React app on Windows environement

I have a working react app that I had hosted on a linux environment, but the client has switched their hosting provider and now I have to run the app on a Windows environment. I personally am unfamiliar with Windows and having some serious issues getting my app to work now.
After loads of debugging and testing I now can get my app to run, but when I start it, it will throw some errors which will results in a broken app in the browser.
So when I run npm start it will start up the app and spit out this error:
Screenshot of the terminal error 1/2
Screenshot of the terminal error 2/2
It seems to spit out some complaints when using npm run watchJS which runs this command babel src --watch --out-dir lib.
I am completely lost at this point and have no idea where to go from here.
I can provide as much detail as anyone needs after looking at the question, I just don't know what else to add to this issue and don't want to fill up this question with irrelevant info.
Thanks in advance for any help
It is likely a bug with the version of npm you are using.
See this thread:
https://github.com/npm/npm/issues/18380
Try rolling back your version of npm to 5.3
The issue appears to be exclusive to windows with babel packages.

NodeJS, Protractor and Chrome DevTools Error

I am trying to get Protractor E2E testing to run on my local Windows workstation at work but I keep getting this error.
webpack: Compiled successfully. [07:50:41] I/file_manager - creating
folder
c:\repos\polo-buyer-ui\node_modules\protractor\node_modules\webdriver-manager\selenium
[07:50:42] I/update - chromedriver: unzipping chromedriver_2.32.zip
[07:50:44] I/launcher - Running 1 instances of WebDriver [07:50:44]
I/direct - Using ChromeDriver directly...
[0925/075047.256:ERROR:devtools_http_handler.cc(786)] DevTools
listening on 127.0.0.1:12985
I am able to get it to work with no issues on a linux workstation and my personal (non-work) PC runnning Windows 10. I find very little information on this error message
[0925/075047.256:ERROR:devtools_http_handler.cc(786)] DevTools
But I get this no matter what I do and I can't figure out why?
Try doing below steps:-
Open cmd and in the home path use below commands.
webdriver-manager clean
webdriver-manager status
webdriver-manager update
webdriver-manager start.
could you please check whether your laptop has any encryption in the system. Few of these encryptions corrupt the node modules , which results in the failure of the test cases.
This is the only reason I could guess since you ran all your test cases earlier
To verify this you could uninstall all the npm files and re-install them again and then re-run your test cases without re-starting your PC
PS : I faced the same issue and we asked IT team to remove encryption for just one folder which will contain all the automation code

Resources