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

Cypress uses the system Node.js when nodeVersion is set to bundled #27016

Closed
JessefSpecialisterren opened this issue Jun 13, 2023 · 3 comments
Closed
Labels
E2E Issue related to end-to-end testing Reproducible Can be reproduced Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug v10.0.0 🐛 Issue present since 10.0.0

Comments

@JessefSpecialisterren
Copy link

Current behavior

When the nodeVersion configuration option is set to bundled, Cypress uses the system Node.js to execute setupNodeEvents and tasks

Desired behavior

I see two ways of fixing this bug:

  1. Fix the nodeVersion configuration option so that bundled works as it used to, and Cypress uses the bundled Node.js to execute setupNodeEvents and tasks
  2. Remove the nodeVersion configuration option altogether, as has been the stated intention since Cypress 9.0.0

My team and I would prefer solution 1, as stated and explained in #18882 . However, that issue didn't gain a lot of traction, so if you choose solution 2 I can understand that

Test code to reproduce

cypress.config.js:

module.exports = {
  e2e: {
    nodeVersion: 'bundled',
    setupNodeEvents(on, config) {
      console.log(process.version)
      on('task', {
        logNodeVersion() {
          console.log(process.version)
          return true
        }
      })
    },
  },
}

spec.cy.js:

it('', () => {
  cy.task('logNodeVersion')
})

Make sure you have a system Node.js with a different version than the bundled Node.js. Note the version logged in the terminal when you select E2E testing and when you run spec.cy.js

Cypress Version

12.14.0

Node version

v18.16.0

Operating System

Windows 10.0.19044.2965

Debug Logs

No response

Other

No response

@mschile
Copy link
Contributor

mschile commented Jun 15, 2023

Hi @JessefSpecialisterren 👋, thanks for taking the time to log this issue. I was able to reproduce your issue and will forward this ticket to the appropriate team. They will evaluate the priority of this ticket and consider their capacity to pick it up. As of right now, the plan is to still remove the nodeVersion configuration in a future major release. It looks like this issue was introduced in Cypress v10. Thanks!

@mschile mschile added type: bug Reproducible Can be reproduced v10.0.0 🐛 Issue present since 10.0.0 E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels Jun 15, 2023
@mschile mschile removed their assignment Jun 15, 2023
@jennifer-shehane
Copy link
Member

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

@jennifer-shehane
Copy link
Member

Released in Cypress 13.0.0.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E2E Issue related to end-to-end testing Reproducible Can be reproduced Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug v10.0.0 🐛 Issue present since 10.0.0
Projects
None yet
Development

No branches or pull requests

3 participants