You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/CHANGELOG.md
+4
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ _Released 07/01/2025 (PENDING)_
8
8
- Removed support for Node.js 18 and Node.js 23. Addresses [#31302](https://github.com/cypress-io/cypress/issues/31302).
9
9
- Removed support for [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol) with the [firefox](https://www.mozilla.org/) browser. Addresses [#31189](https://github.com/cypress-io/cypress/issues/31189).
10
10
11
+
**Features:**
12
+
13
+
-[`tsx`](https://tsx.is/) is now used in all cases to run the Cypress config, replacing [ts-node](https://github.com/TypeStrong/ts-node) for TypeScript and Node for commonjs/ESM. This should allow for more interoperability for users who are using any variant of ES Modules. Addresses [#30954](https://github.com/cypress-io/cypress/issues/30954), [#30925](https://github.com/cypress-io/cypress/issues/30925), and [#31185](https://github.com/cypress-io/cypress/issues/31185).
// NOTE: The IDE in which you are working likely will not let attach to this process until it is running if using the --inspect option
280
+
// If needing to debug the child process (webpack-dev-server/vite-dev-server/webpack-preprocessor(s)/config loading), you may want to use --inspect-brk instead
281
+
// as it will NOT execute that process until you attach the debugger to it.
282
282
.push(`--inspect=${process.debugPort+1}`)
283
283
.value()
284
284
}
285
285
286
-
debug('fork child process %o',{CHILD_PROCESS_FILE_PATH, configProcessArgs,childOptions: _.omit(childOptions,'env')})
287
-
288
-
letisProjectUsingESModules=false
286
+
/**
287
+
* Before the introduction of tsx, Cypress used ts-node (@see https://github.com/TypeStrong/ts-node) with native node to try and load the user's cypress.config.ts file.
288
+
* This presented problems because the Cypress node runtime runs in commonjs, which may not be compatible with the user's cypress.config.ts and tsconfig.json.
289
+
* To mitigate the aforementioned runtime incompatibility, we used to force TypeScript options for the user in order to load their config inside the our node context
290
+
* via a child process, which lead to clashes and issues (outlined in the comments below).
291
+
* This is best explained historically in our docs which a screenshot can be see in @see https://github.com/cypress-io/cypress/issues/30426#issuecomment-2805204540 and can be seen
292
+
* in an older version of the Cypress codebase (@see https://github.com/cypress-io/cypress/blob/v14.3.0/packages/server/lib/plugins/child/ts_node.js#L24)
293
+
*
294
+
* Attempted workarounds with ts-node and node: @see https://github.com/cypress-io/cypress/pull/28709
295
+
* Example continued end user issues: @see https://github.com/cypress-io/cypress/issues/30954 and @see https://github.com/cypress-io/cypress/issues/30925
296
+
* Spike into ts-node alternatives (a lot of useful comments on tsx): @see https://github.com/cypress-io/cypress/issues/30426
297
+
* feature issue to replace ts-node as our end user TypeScript loader: @see https://github.com/cypress-io/cypress/issues/31185
298
+
*
299
+
* tsx (@see https://tsx.is/) is able to work with both CommonJS and ESM at the same time ( @see https://tsx.is/#seamless-cjs-%E2%86%94-esm-imports), which solves the problem of interoperability that
300
+
* Cypress faced with ts-node and really just node itself. We no longer need experimental node flags and ts-node permutations to load the user's config file.
301
+
* We can use tsx to load just about anything, including JavaScript files (@see https://github.com/privatenumber/ts-runtime-comparison)!
0 commit comments