Skip to content

Creating new app with typescript template giving an error on yarn start #8716

Closed
@ericdsw

Description

@ericdsw

Describe the bug

I was trying to create a new react app using typescript, but I ran into an issue when trying to run it. I ran the npx create-react-app just_testing --template typescript and everything installed correctly, but when I ran yarn start to test it I got the following error:

TypeScript error in /Users/ericdesedas/Development/projects/javascript/just_testing_2/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts(7,13):
'=' expected.  TS1005

     5 |  * LICENSE file in the root directory of this source tree.
     6 |  */
  >  7 | import type * as PrettyFormat from './types';
       |             ^
     8 | /**
     9 |  * Returns a presentation string of your `val` object
    10 |  * @param val any potential JavaScript object

Did you try recovering your dependencies?

yarn version: 1.22.4
npm version: 6.13.7

Environment

This is what I get when I run npx create-react-app --info:

Environment Info:

  current version of create-react-app: 3.4.1
  running from /Users/ericdesedas/.config/yarn/global/node_modules/create-react-app

  System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
  Binaries:
    Node: 13.9.0 - ~/.nvm/versions/node/v13.9.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.7 - ~/.nvm/versions/node/v13.9.0/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: Not Found
    Safari: 13.0.5
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.1 => 3.4.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

It appears that creating a new react app with typescript is installing a dependency with some kind of release error.

  1. Run npx create-react-app my_app --template typescript
  2. Wait for the installation to finish
  3. Run yarn start and watch the error in PrettyFormat.

Note: I also tried to run yarn create react-app just_testing --typescript`, but the error kept showing up.

Expected behavior

I assumed that a brand new react app should be able to run without issue.

Actual behavior

The only output I got is what I showed as the error in a previous section, both in the terminal and in the browser.

Reproducible demo

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions