cypress-io / code-coverage

Saves the code coverage collected during Cypress tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing moment dependency

lribac opened this issue · comments

Really interested in using this tool but haven't been able to get pass the moment dependency issue. Some posts suggest that the new versions should be using dayjs but I still get the moment usage in the latest version. Have also tried using older versions but still getting the issue every time.

Logs and screenshots
Screenshot 2023-06-14 at 2 29 44 PM

Versions
code-coverage version: 3.10.7
Cypress version: 12.14.0

Hi @lribac , sorry you're having issues. From the path in the error (.../@cypress/react/node_modules/@cypress/code-coverage/support.js) it looks like your project is attempting to use a version of @cypress/code-coverage that's a transitive dependency (which happens to be an older version). Can you confirm a couple things?

  1. Your project has @cypress/code-coverage as a direct dev dependency (listed in your package.json?
  2. Your cypress.config.js file imports from that direct dependency via require('@cypress/code-coverage/task')(on, config)
  3. Your support file imports from the direct dependency import '@cypress/code-coverage/support'

If those are all valid, can you share your project or a minimal reproduction case?

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

The issue was using cypress/react outdated dependency. Upgrading to the latest version solved it. Thank you!

Thanks for circling back with a resolution @lribac , glad you got it resolved. Thanks for using Cypress!