-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "cy.task() must only be invoked from the spec file or support file" #667
Comments
I confirm, I got the same error when using cypress 12.15.0, it work using cypress 12.14.0. |
Just updated to 12.5.0 from 12.4.0 and coverage failed with the same error above. |
Be sure to use 12.14 and not 12.15, use npm add cypress and the wanted
version
…On Wed, Jun 21, 2023 at 17:53 viktorgogulenko ***@***.***> wrote:
Just updated to 12.5.0 from 12.4.0 and coverage failed with the same error
above.
—
Reply to this email directly, view it on GitHub
<#667 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFJFCGEU4O2QV73QEWMWOPDXMMKG3ANCNFSM6AAAAAAZOC5JTE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
We are also facing the same problem. |
Also seeing this error in my tests, is there a change made to cy.task (don't see it documented) or is it regression introduced in 12.15.0 Also similar issue with |
Seem to be a regression
…On Thu, Jun 22, 2023 at 09:49 atmullan ***@***.***> wrote:
Also seeing this error in my tests, is there a change made to cy.task
(don't see it documented) or is it regression introduced in 12.15.0
—
Reply to this email directly, view it on GitHub
<#667 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFJFCGF4QXQ4SNK6GRYWRE3XMP2H7ANCNFSM6AAAAAAZOC5JTE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Also suffering this problem in our project. Works on |
Same here, can confirm code coverage works with 12.14.0 but breaks with 12.15.0. Especially with a wired payload error message on the console output. Could first really encounter the issue when having cypress run in headed mode. |
I am also blocked with the version upgrade due to this error. Wondering, the |
Cypress v12.16.0 has just been released with a fix for the issue with Thanks for using Cypress, everyone! |
Hi everyone, sorry to hear folks are still seeing issues. We identified and fixed an issue that caused this sort of error in 12.16.0 but it appears there are some edge cases that still exist. This error doesn't seem to be specifically related to the |
Perhaps the new version helped me. I was using |
@anilpujaraofficial can you share the test in which you are using cy.writeFile()? |
Hi @mike-plummer, I can confirm the issue persists with the latest release (13.5.0). |
@adrienharnay This issue has been closed for some time now. If you have an example of it still occurring with the latest version of Cypress please open a new issue with a reproducible example that we can use to diagnose your problem. |
Here you ho: cypress-io/cypress#28336 |
Versions
What is this plugin's version? If this is NOT the latest released version can you try the latest version, please?
3.10.7
What is Cypress version?
12.15.0
, the problem doesn't seem to happen with12.14.0
What is your operating system? Linux Manjaro
What is the shell? zsh
What is the Node version? v18.16.0
What is the NPM version? 9.6.6
How do you instrument your application? istanbul
When running tests, if you open the web application in regular browser, and open DevTools, do you see
window.__coverage__
object? Can you paste a screenshot?Is there
.nyc_output
folder? Is there.nyc_output/out.json
file. Is it empty? Can you paste at least part of it so we can see the keys and file paths?All entries seem to looks the same with the form:
Do you have any custom NYC settings in
package.json
(nyc
object) or in other NYC config filesDo you run Cypress tests in a Docker container? no
Describe the bug
When running any test on my computer, even if the test seems to conclude properly, I get a failure and the following log:
This works fine with cypress version 12.14; is there some specific thing to change, I have not seen anything specific related to this in the cypress changelog
This seems to fail both with chrome and chrome headless mode.
Link to the repo
I'm not sure this is entirely necessary, but if it is let me know and I will try to provide something.
The text was updated successfully, but these errors were encountered: