-
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: support loading config files for projects with type module, without esbuild #21574
Conversation
Thanks for taking the time to open a PR!
|
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.
Would like to see some tests for this, either fixing the existing tests or a new integration test. This error message comparison seems prone to regressions.
…ts do not use local dev version of esbuild
There was a test already written, but it wasn't failing correctly due to differences between prod and test. When running system-tests, was designed to cover. By adding |
@@ -111,14 +111,14 @@ function run (ipc, file, projectRoot) { | |||
try { | |||
debug('Trying to use esbuild to run their config file.') | |||
// We prefer doing this because it supports TypeScript files | |||
require.resolve('esbuild') | |||
require.resolve('esbuild', { paths: [process.cwd()] }) |
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.
The absence of this line was actually a bug and it was only working on my machine because of some GLOBAL transitive deps with esbuild
.
To debug this, you can add
require.resolve.paths('esbuild')
to a production-built binary installed in a real project. We should really consider moving some of these low-dependency or no-dependency tests OUTSIDE of the system-tests and into the binary-system-tests
phase.
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 |
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.
Looks like there's a test failing now just FYI. Think it might just be a matter of adding esbuild
to config-with-ts-module-error
system test or something
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.
@JessicaSachs Update the base branch to be against develop before merging.
…le-projects-without-esbuild
…ess-io/cypress into fix/module-projects-without-esbuild
…ess-io/cypress into fix/module-projects-without-esbuild
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.
Updated the tests to capture the fact that without esbuild
, .ts
files do not work. Logged #21939 to track updates to support that.
@flotwig or @lmiller1990 I could use a hand in figuring out why the existing test suite here does not fail.
Do we always have
esbuild
in the require callstack? I thought we sandboxed the node_modules well enough in the temp dir.User facing changelog
We now support Cypress Config files for project that have
"type": "module"
in their package.json, but do not have a dependency onesbuild
.