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
Running Cypress component testing in a Vite v5 based JavaScript project in a monorepo, where TypeScript is a transient dependency only in the root of the monorepo, results in additional warnings if the dependencies in the repo root are also installed:
(node:5542) ExperimentalWarning: --experimental-loader may be removed in the future; instead use register():
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs", pathToFileURL("./"));'
(Use node --trace-warnings ... to show where the warning was created)
(node:5542) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use node --trace-deprecation ... to show where the warning was created)
Desired behavior
The results of running Cypress component testing in a monorepo JavaScript project should be independent of whether the TypeScript dependencies in the root of the repo have been installed or not.
Test code to reproduce
Execute first:
git clone https://github.com/cypress-io/github-action
cd github-action
git clean -xfd # if repeating tests
npm ci
cd examples/component-tests
npm ci
npm test
which shows multiple node warnings (see above, and Debug Logs below), then execute:
rm -rf ../../node_modules
npm test
and confirm only the CJS deprecation warning is output:
$ npm test
> [email protected] test
> cypress run --component
DevTools listening on ws://127.0.0.1:40257/devtools/browser/ced1c3dd-9c2a-40a8-94b8-12afea482130
(node:5542) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5542) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 14.0.0 │
│ Browser: Electron 130 (headless) │
│ Node Version: v22.13.0 (/home/mike/n/bin/node) │
│ Specs: 1 found (Stepper.cy.jsx) │
│ Searched: **/*.cy.{js,jsx,ts,tsx} │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
with root dependencies installed:
cypress:lifecycle:ProjectConfigIpc fork child process { CHILD_PROCESS_FILE_PATH: '/home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/require_async_child.js', configProcessArgs: [ '--projectRoot', '/home/mike/github/cypress-io/github-action/examples/component-tests', '--file', '/home/mike/github/cypress-io/github-action/examples/component-tests/cypress.config.js' ], childOptions: { stdio: 'pipe', cwd: '/home/mike/github/cypress-io/github-action/examples/component-tests', execPath: '/home/mike/n/bin/node' } } +0ms
cypress:lifecycle:ProjectConfigIpc found typescript in /home/mike/github/cypress-io/github-action/examples/component-tests +3ms
cypress:lifecycle:ProjectConfigIpc using --experimental-specifier-resolution=node with --loader file:///home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs +3ms
cypress:lifecycle:ProjectConfigIpc detected node version 22.13.0, adding --no-experimental-detect-module option to child_process NODE_OPTIONS. +1ms
cypress:lifecycle:ProjectConfigIpc detected node version 22.13.0, adding --no-experimental-require-module option to child_process NODE_OPTIONS. +0ms
cypress:lifecycle:ProjectConfigIpc trigger the load of the file +17ms
(node:6747) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6747) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
cypress:lifecycle:ProjectConfigIpc loadConfig:reply +729ms
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
when root dependencies not installed:
cypress:lifecycle:ProjectConfigIpc fork child process { CHILD_PROCESS_FILE_PATH: '/home/mike/.cache/Cypress/14.0.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/require_async_child.js', configProcessArgs: [ '--projectRoot', '/home/mike/github/cypress-io/github-action/examples/component-tests', '--file', '/home/mike/github/cypress-io/github-action/examples/component-tests/cypress.config.js' ], childOptions: { stdio: 'pipe', cwd: '/home/mike/github/cypress-io/github-action/examples/component-tests', execPath: '/home/mike/n/bin/node' } } +0ms
cypress:lifecycle:ProjectConfigIpc no typescript found, just use regular Node.js +3ms
cypress:lifecycle:ProjectConfigIpc trigger the load of the file +12ms
cypress:lifecycle:ProjectConfigIpc loadConfig:reply +468ms
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Current behavior
Running Cypress component testing in a Vite v5 based JavaScript project in a monorepo, where TypeScript is a transient dependency only in the root of the monorepo, results in additional warnings if the dependencies in the repo root are also installed:
Desired behavior
The results of running Cypress component testing in a monorepo JavaScript project should be independent of whether the TypeScript dependencies in the root of the repo have been installed or not.
Test code to reproduce
Execute first:
which shows multiple
node
warnings (see above, and Debug Logs below), then execute:rm -rf ../../node_modules npm test
and confirm only the CJS deprecation warning is output:
Cypress Version
14.0.0
Node version
v22.13.0
LTSOperating System
Ubuntu
24.04.1
LTSDebug Logs
with root dependencies installed:
when root dependencies not installed:
Other
Related
--experimental-loader
" #30318The text was updated successfully, but these errors were encountered: