Skip to content

Typescript templates not compiling #4172

Open
@jfacchini

Description

@jfacchini

Describe the bug
I just created a new App using the Typescript template but I'm getting the following compilation error

❯ yarn tsc --noemit
error TS5070: Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.

node_modules/@tsconfig/create-react-app/tsconfig.json:9:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.

9     "moduleResolution": "bundler",
                          ~~~~~~~~~


Found 2 errors in the same file, starting at: node_modules/@tsconfig/create-react-app/tsconfig.json:9

Upon investigation it seems this error has been introdued by the @tsconfig/create-react-app package to version >= 2, but this configuration expect a version of Typescript >= 5 which accepts the value bundler for the moduleResolution config.

I've tried to update typescript dependency to version 5.1.6 and I'm not getting any compilation error and it seems to be running fine in development mode.

To Reproduce
Steps to reproduce the behavior:

  1. npx create-contentful-app my-app
  2. select Template
  3. select Typescript
  4. cd my-app
  5. npx tsc --noemit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions