-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: #22038 support esm import for windows #22042
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…ypress-io/cypress into tgriesser/fix/22038-esm-import-windows * 'tgriesser/fix/22038-esm-import-windows' of github.com:cypress-io/cypress: fix: Change ffmpeg to post process at priority 20 (#21587)
@@ -44,6 +44,7 @@ function scaffoldAndOpenE2EProject (opts: { | |||
cy.contains('E2E Testing').click() | |||
cy.contains('We added the following files to your project:') | |||
cy.contains('Continue').click() | |||
cy.contains('Choose a Browser') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We weren't confirming the flow completed, which meant we were missing a failure here
…hub.com:cypress-io/cypress into tgriesser/fix/change-typescript-detection-rules * 'tgriesser/fix/change-typescript-detection-rules' of github.com:cypress-io/cypress: fix: do not watch specs on run mode (#22060) fix: #22038 support esm import for windows (#22042) fix: Change ffmpeg to post process at priority 20 (#21587)
// Certain modules cannot be dynamically imported. | ||
|
||
// pathToFileURL for windows interop: https://github.com/nodejs/node/issues/31710 | ||
return await import(pathToFileURL(file).href) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the file is a .ts
file, we will get a problem, though, since native imports do not support .ts
.
#22071
I will look into it.
User facing changelog
Improved support for ESM imports in windows
Additional details
ESM imports on windows must be transformed to a proper
file://
prefixed path. The recommended way to handle this is with thepathToFileURL
utility exported fromurl
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?