-1

Testcafe is unable to compile my test with yarn pnp, I run into the following error after switching to yarn pnp by setting these two properties inside of .yarnrc:

nodeLinker: "pnp"
pnpMode: "strict"

The error message:

code: 'E1035'
Error: TypeScript compilation failed.
C:/testcafe/test.ts (13, 17): File name 
'C:/testcafe/.yarn/cache/testcafe-npm-2.0.0-395078fea1-9192f88fb7.zip/node_modules/testcafe/ts-defs/index.d.ts' 
differs from already included file name 
'c:/testcafe/.yarn/cache/testcafe-npm-2.0.0-395078fea1-9192f88fb7.zip/node_modules/testcafe/ts-defs/index.d.ts' only in casing.
  The file is in the program because:
    Root file specified for compilation
    Imported via 'testcafe' from file 'C:/testcafe/test.ts' with packageId 'testcafe/ts-defs/index.d.ts@2.0.0'

forceConsistentCasingInFileNames: false does not function as a workaround as it is not the file but path name

Ari
  • 1,361
  • 1
  • 15
  • 23

1 Answers1

0

It looks like this issue is related to "yarn" and has already been fixed (see https://github.com/yarnpkg/yarn/pull/7007). Make sure you are using the yarn version with the necessary fix.

mlosev
  • 5,130
  • 1
  • 19
  • 31
  • I am using the latest yarn version, my guess is that the issue is, while yarn uses lower case only, testcafe might import itself internally during compillation with a uppercase drive letter – Ari Sep 23 '22 at 10:17
  • It is not clear from your description how you encountered this error. Please share with us the steps required to reproduce it. – Ilya Afanasenko Sep 26 '22 at 09:11
  • I have set the nodeLinker and pnpmode property inside the .yarnrc file to activate pnp, then i tried to run a test, the error occurs during testcafe runtime but before tests are executed – Ari Oct 06 '22 at 09:22
  • I tried to reproduce the problem by using the steps you described, but didn't manage to. Please add changes to the https://github.com/felis2803/testcafe-temp-5 repository so that the bug can be reproduced, or create your own repository that we can run and explore. – Ilya Afanasenko Oct 10 '22 at 08:39