-
Notifications
You must be signed in to change notification settings - Fork 107
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
CypressError: cy.task('coverageReport')
failed - 'path' must be a string or Uint8Array
#582
Comments
@xrutayisire Were you able to resolve this? I'm running into a similar issue myself |
@vinnymicale did you manage to solve that issue? |
I am receiving the exact same error. Would be nice if someone from cypress could at least respond. |
Hello all. I tried it out, same issue.
I logged the path, one is like this:
It's duplicating the directory. Coming from https://github.com/search?q=repo%3Acypress-io%2Fcode-coverage+istanbul-lib-coverage&type=code |
Error occurs when we get here: https://github.com/istanbuljs/nyc/blob/ab7c53b2f340b458789a746dff2abd3e2e4790c3/index.js#L456-L463 I am still trying to find the part where the path is joined incorrectly, but I am not sure I will be able to get to the bottom of it. Anyone else interested in helping? Is this only happening on certain projects/configuration? |
I was able to nail it down to this line: https://github.com/istanbuljs-archived-repos/istanbul-lib-report/blob/master/lib/file-writer.js#L156 and hot-fix it with Our setup is cypress + vite + vue3 and our project is a monorepo where the e2e tests executed by cypress and collecting the coverage are in a dedicated package. The path to that dedicated package is what somehow ends up with the null-byte at the end of the path. The weird thing is that it does not happen anymore now. I removed by hotfix and it still works. Somewhere along the lines I must have made a config change to prevent that nullbyte. Edit: |
What the heck 🤔 We have updated our RWA cypress-io/cypress-realworld-app#1381 to Vite + code coverage and it's working. This might be a useful example for anyone running into issues. The problem is not really clear here, I am unsure what's going on. |
Logs and screenshots
DEBUG=code-coverage yarn cypress:run
Versions
What is this plugin's version? If this is NOT the latest released version can you try the latest version, please?
"@cypress/code-coverage": "3.10.0"
If the plugin worked before in version X, but stopped after upgrading to version Y, please try the released versions between X and Y to see where the breaking change was.
Never tried this with another version before
What is Cypress version?
10.3.0
What is your operating system?
OSX 12.1
What is the shell?
bash
What is the Node version?
v16.14.0
What is the NPM version?
8.3.1
How do you instrument your application? Cypress does not instrument web application code, so you need to do it yourself.
vite.config.js
cypress.config.js
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?.nyc_output/out.json
https://github.com/xrutayisire/cypress-react-typescript-vite-example/blob/main/.nyc_output/out.json
Do you have any custom NYC settings in
package.json
(nyc
object) or in other NYC config filesNo custom settings
Do you run Cypress tests in a Docker container?
No
Describe the bug
Terminal 1:
yarn
yarn build
npx serve -s dist -p 4242
Terminal 2:
DEBUG=code-coverage yarn cypress:run
⇒ Cypress Error appear
Link to the repo
https://github.com/xrutayisire/cypress-react-typescript-vite-example
The text was updated successfully, but these errors were encountered: