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: #22038 support esm import for windows #22042

Merged
merged 9 commits into from
Jun 2, 2022

Conversation

tgriesser
Copy link
Member

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 the pathToFileURL utility exported from url

Steps to test

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 2, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jun 2, 2022



Test summary

37553 0 454 0Flakiness 5


Run details

Project cypress
Status Passed
Commit 0a43737
Started Jun 2, 2022 6:30 PM
Ended Jun 2, 2022 6:46 PM
Duration 16:17 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
next.cy.ts Flakiness
1 Working with next-12.1.6 > should detect new spec
cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second
2 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second
e2e/origin/commands/assertions.cy.ts Flakiness
1 cy.origin assertions > #consoleProps > .should() and .and()

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

tgriesser added 4 commits June 2, 2022 11:15
…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)
@tgriesser tgriesser marked this pull request as ready for review June 2, 2022 15:35
@tgriesser tgriesser requested a review from a team as a code owner June 2, 2022 15:35
@tgriesser tgriesser requested review from jennifer-shehane and removed request for a team June 2, 2022 15:35
@@ -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')
Copy link
Member Author

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

@jennifer-shehane jennifer-shehane removed their request for review June 2, 2022 15:40
@tgriesser tgriesser requested review from estrada9166 and flotwig June 2, 2022 15:43
@tgriesser tgriesser changed the title fix: #22038 esm import for windows fix: #22038 support esm import for windows Jun 2, 2022
@tgriesser tgriesser requested a review from a team as a code owner June 2, 2022 18:23
@tgriesser tgriesser merged commit b83bdc2 into develop Jun 2, 2022
@tgriesser tgriesser deleted the tgriesser/fix/22038-esm-import-windows branch June 2, 2022 19:24
tgriesser added a commit that referenced this pull request Jun 2, 2022
…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)
ZachJW34 added a commit that referenced this pull request Jun 2, 2022
// Certain modules cannot be dynamically imported.

// pathToFileURL for windows interop: https://github.com/nodejs/node/issues/31710
return await import(pathToFileURL(file).href)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error [ERR_REQUIRE_ESM]: require() of ES Module during Cypress upgrade to the v10.0.1
5 participants