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

fix: error loading config file with node 22.12.0 #30730

Merged
merged 6 commits into from
Dec 11, 2024
Merged

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented Dec 9, 2024

Additional details

Starting with node 22.12.0, experimental-require-module is now enabled by default which may cause an error loading the config file if it is loaded as an ESM.

Steps to test

Using Node 22.12.0, setup a typescript project with type: 'module in the package.json. In the cypress.config.ts file, ensure to use typescript syntax, such as:

setupNodeEvents: (_, config: Cypress.PluginConfigOptions) => {
  return config
},

How has the user experience changed?

Before:
Screenshot 2024-12-10 at 9 19 47 AM

After:
Screenshot 2024-12-10 at 9 21 26 AM

PR Tasks

Copy link

cypress bot commented Dec 9, 2024

cypress    Run #58796

Run Properties:  status check passed Passed #58796  •  git commit dd2c3a8127: update changelog
Project cypress
Branch Review ryanm/experiment/esm
Run status status check passed Passed #58796
Run duration 18m 48s
Commit git commit dd2c3a8127: update changelog
Committer Matthew Schile
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 949
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4679
View all changes introduced in this branch ↗︎

@mschile mschile self-assigned this Dec 10, 2024
@mschile mschile changed the title fix: esm -- run ci fix: error loading config file with node 22.12.0 Dec 10, 2024
@ryanthemanuel
Copy link
Collaborator Author

Looks good to me.

Copy link
Contributor

@mschile mschile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for @ryanthemanuel. I wrote the code but since he opened the initial PR, he is not able to directly approve the PR.

@mschile mschile merged commit 73de0a8 into develop Dec 11, 2024
99 of 100 checks passed
@mschile mschile deleted the ryanm/experiment/esm branch December 11, 2024 02:36
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 17, 2024

Released in 13.17.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Your configFile is invalid with Node.js 22.12.0
2 participants