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
I have a bit of a strange project setup, but this was working prior to 12.10.0, so I think it's worthy of listing as a bug as maybe you guys might see it as a regression? Let's see what you guys think.
So, I have a monorepo of packages using Yarn workspaces. In this, I have a number of projects which have their own TypeScript files. So, let's say I have package @spiltcoffee/a that uses package @spiltcoffee/b, and there's TypeScript in b that is being used by a. To get this to work, I've been setting the ts-nodeignore to something like the following in my tsconfig.json:
Due to some additional project layout that I won't get into, I also needed to use NODE_OPTIONS=--preserve-symlinks, which means that even though Yarn has setup a folder node_modules/@spiltcoffee/b as a symbolic link, the script isn't allowed to resolve that link to it's underlying folder. If I didn't need to use --preserve-symlinks, the above ignore would not be required.
As part of 12.10.0, it appears that Cypress has become opinionated about the ignore, so the above configuration is blown away by this:
As a result, I cannot run my Cypress project anymore in 12.10.0 or higher, as my cypress.config.ts makes a reference to a TypeScript file in @spiltcoffee/b:
Your configFile is invalid: <snip>\@spiltcoffee\a\cypress.config.ts
It threw an error when required, check the stack trace below:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for <snip>\@spiltcoffee\a\cypress.config.ts
at new NodeError (node:internal/errors:399:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
at defaultGetFormat (node:internal/modules/esm/get_format:121:38)
at defaultLoad (node:internal/modules/esm/load:81:20)
at nextLoad (node:internal/modules/esm/loader:163:28)
at ESMLoader.load (node:internal/modules/esm/loader:605:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
at new ModuleJob (node:internal/modules/esm/module_job:64:26)
at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:480:17)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Desired behavior
That my ts-nodeignore value is respected or merged into the ignore value Cypress sets.
@spiltcoffee I have replicated your problem in the latest version of Cypress and will forward this ticket to the appropriate team. They will soon evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!
warrensplayer
added
E2E
Issue related to end-to-end testing
Triaged
Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
labels
Jun 12, 2023
Current behavior
I have a bit of a strange project setup, but this was working prior to 12.10.0, so I think it's worthy of listing as a bug as maybe you guys might see it as a regression? Let's see what you guys think.
So, I have a monorepo of packages using Yarn workspaces. In this, I have a number of projects which have their own TypeScript files. So, let's say I have package
@spiltcoffee/a
that uses package@spiltcoffee/b
, and there's TypeScript inb
that is being used bya
. To get this to work, I've been setting thets-node
ignore
to something like the following in mytsconfig.json
:Due to some additional project layout that I won't get into, I also needed to use
NODE_OPTIONS=--preserve-symlinks
, which means that even though Yarn has setup a foldernode_modules/@spiltcoffee/b
as a symbolic link, the script isn't allowed to resolve that link to it's underlying folder. If I didn't need to use--preserve-symlinks
, the aboveignore
would not be required.As part of 12.10.0, it appears that Cypress has become opinionated about the
ignore
, so the above configuration is blown away by this:cypress/packages/server/lib/plugins/child/ts_node.js
Lines 49 to 60 in c94efb8
As a result, I cannot run my Cypress project anymore in 12.10.0 or higher, as my
cypress.config.ts
makes a reference to a TypeScript file in@spiltcoffee/b
:Desired behavior
That my
ts-node
ignore
value is respected or merged into theignore
value Cypress sets.Test code to reproduce
See https://github.com/spiltcoffee/cypress-ts-node-ignore-bug
Cypress Version
12.10.0
Node version
v18.16.0
Operating System
Windows 10.0.19045
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: