remix-run/blues-stack

`npm run typecheck` fails on fresh project

ElanHasson opened this issue ยท 7 comments

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Create a bluestack via npx create-remix@latest and choose bluestack. Follow instructions, run npm run typecheck.

Expected Behavior

Tests should pass out of the box.

Actual Behavior

Tests fail:

npm run typecheck 

> typecheck
> tsc && tsc -p cypress

error TS2688: Cannot find type definition file for '@testing-library/cypress'.
  The file is in the program because:
    Entry point of type library '@testing-library/cypress' specified in compilerOptions

  cypress/tsconfig.json:15:34
    15     "types": ["node", "cypress", "@testing-library/cypress"],
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
    File is entry point of type library specified here.

error TS2688: Cannot find type definition file for 'cypress'.
  The file is in the program because:
    Entry point of type library 'cypress' specified in compilerOptions

  cypress/tsconfig.json:15:23
    15     "types": ["node", "cypress", "@testing-library/cypress"],
                             ~~~~~~~~~
    File is entry point of type library specified here.


Found 2 errors.

Hello ๐Ÿ‘‹ ! I've encountered the same issues. They seem related to TypeScript 5.1.3. Everything functions perfectly when I downgrade to TypeScript 5.0.4.

cf: cypress-io/cypress#26930

Heh so much for semantic versioning.

Thanks

Heh so much for semantic versioning.

Thanks

Fun fact: TypeScript does not follow SemVer, even though at first glance it seems they do.

Source: microsoft/TypeScript#14116

anyone found a workaround?

TIL thanks @kinggoesgaming

The solution for this is to specify path to the type files in typeRoots. For example cypress types from the root directory would look like the following:

"typeRoots": ["./node_modules", "./node_modules/@types"],

Will be fixed by #194