Skip to content
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

11.0.0 cypress run -> Error: Cannot find module 'mocha-7.0.1' #24607

Closed
jiadesen opened this issue Nov 9, 2022 · 12 comments · Fixed by #24630
Closed

11.0.0 cypress run -> Error: Cannot find module 'mocha-7.0.1' #24607

jiadesen opened this issue Nov 9, 2022 · 12 comments · Fixed by #24630
Labels
type: regression A bug that didn't appear until a specific Cy version release

Comments

@jiadesen
Copy link

jiadesen commented Nov 9, 2022

Current behavior

When I upgraded to 11.0.0, I ran cypress run as usual, and I got an error Error: Cannot find module 'mocha-7.0.1'

Desired behavior

No response

Test code to reproduce

const { defineConfig } = require('cypress')

module.exports = defineConfig({
reporter: 'mochawesome',
reporterOptions: {
reportDir: 'cypress/results',
overwrite: false,
html: false,
json: true
}
})

Cypress Version

11.0.0

Node version

v16.18.0

Operating System

macOS 13.0

Debug Logs

[1] Error loading the reporter: mochawesome
[1] 
[1] We searched for the reporter in these paths:
[1] 
[1]  - /Users/xxx/project/mochawesome
[1]  - /Users/xxx/project/node_modules/mochawesome
[1] 
[1] Learn more at https://on.cypress.io/reporters
[1] 
[1] Error: Cannot find module 'mocha-7.0.1'
[1] Require stack:
[1] - /Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/server/lib/reporter.js
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
[1]     at n._resolveFilename (node:electron/js2c/browser_init:249:1105)
[1]     at PackherdModuleLoader._tryResolveFilename (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:645:32)
[1]     at PackherdModuleLoader._resolvePaths (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:491:31)
[1]     at PackherdModuleLoader.tryResolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:313:40)
[1]     at resolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/require.js:125:33)
[1]     at require.resolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/v8-snapshot-require/dist/snapshot-require.js:216:28)
[1]     at customRequire.resolve (<embedded>:2809:961257)
[1]     at <embedded>:2755:13102
[1]     at i._load (<embedded>:2750:54101)
[1]     at Module.require (node:internal/modules/cjs/loader:1012:19)
[1]     at require (node:internal/modules/cjs/helpers:102:18)
[1]     at Object.<anonymous> (/Users/xxx/project/node_modules/.pnpm/mochawesome@7.1.3_mocha@10.1.0/node_modules/mochawesome/src/mochawesome.js:1:14)
[1]     at Module._compile (node:internal/modules/cjs/loader:1120:14)
[1]     at Module._extensions..js (node:internal/modules/cjs/loader:1175:10)
[1]     at Module.load (node:internal/modules/cjs/loader:988:32)
[1]     at Module._load (node:internal/modules/cjs/loader:829:12)
[1]     at c._load [as origLoad] (node:electron/js2c/asar_bundle:5:13339)
[1]     at PackherdModuleLoader.tryLoad (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:432:30)
[1]     at customRequire (<embedded>:2809:960157)
[1]     at S.loadReporter (<embedded>:2755:19452)
[1]     at P.initializeReporter (<embedded>:2802:336581)
[1]     at P.startWebsockets (<embedded>:2802:336891)
[1]     at P.open (<embedded>:2802:335033)
[1]     at async v.create (<embedded>:2802:347432)
[1]     at async O (<embedded>:2802:421364)
[1]     at async W (<embedded>:2802:432780)

Other

No response

@jiadesen
Copy link
Author

jiadesen commented Nov 9, 2022

Installing mocha-7.0.1 still reports this error

@jiadesen jiadesen changed the title Error: Cannot find module 'mocha-7.0.1' 11.0.0 cypress run -> Error: Cannot find module 'mocha-7.0.1' Nov 9, 2022
@kryshenp
Copy link

kryshenp commented Nov 9, 2022

we also have the same issue after cypress updated to 11.0.0.
Our configuration is the same as mentioned in the description.

@kimberley2310
Copy link

Same issue here, we didn't change anything in our configuration.
The pipeline started our cypress run for the first time with version 11 and we have the same error.

Locally I was still on version 10 of cypress -> no problems there
Updated locally to version 11 -> same problem

We use 'cypress-multi-reports':

reporter: 'cypress-multi-reporters',
  reporterOptions: {
    reporterEnabled: 'mocha-junit-reporter',
    mochaJunitReporterReporterOptions: {
      mochaFile: 'reports/cypress/xml/e2e-test-results-[hash].xml',
    },
  },

@aliaksei-liauchuk-incountry

I have same issue

@emilyrohrbough
Copy link
Member

We are actively investigating the issue.

@emilyrohrbough emilyrohrbough added type: regression A bug that didn't appear until a specific Cy version release routed-to-e2e labels Nov 9, 2022
@cypress-bot cypress-bot bot added the stage: needs review The PR code is done & tested, needs review label Nov 9, 2022
@LinF001
Copy link

LinF001 commented Nov 9, 2022

The Same issue for me.

@studentIvan
Copy link

same

@xometa
Copy link

xometa commented Nov 9, 2022

Same issue

@atmullan
Copy link

atmullan commented Nov 9, 2022

Similar issue only it was modules related to babel which I don't use, tried various npm solutions. Downgrading cypress to previous version was only solution.

@ryanthemanuel
Copy link
Collaborator

Similar issue only it was modules related to babel which I don't use, tried various npm solutions. Downgrading cypress to previous version was only solution.

@atmullan, that issue sounds like #24611. Both of these will be fixed with #24630.

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Nov 10, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 10, 2022

The code for this is done in cypress-io/cypress#24630, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@mjhenkes
Copy link
Member

Released in 11.0.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v11.0.1, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A bug that didn't appear until a specific Cy version release
Projects
None yet