Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #11979
Closed
Open
Issue created Jan 24, 2022 by Administrator@rootContributor

react-scripts v5 type checks test files when running start command

Created by: jwalton9

Describe the bug

When upgrading to react-scripts v5, and running react-scripts start or react-scripts build any .test.ts or .spec.ts file with type errors are reported to the build process and the build fails.

Did you try recovering your dependencies?

I started a fresh project to reproduce the error and the bug still exists

Which terms did you search for in User Guide?

Typescript, types, tests.

Environment

Environment Info:

  current version of create-react-app: 5.0.0
  running from /Users/joewalton/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

  System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 16.13.1 - ~/.asdf/installs/nodejs/16.13.1/bin/node
    Yarn: 1.22.17 - ~/.asdf/installs/nodejs/16.13.1/.npm/bin/yarn
    npm: 8.1.2 - ~/.asdf/installs/nodejs/16.13.1/bin/npm
  Browsers:
    Chrome: 97.0.4692.71
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.1
  npmPackages:
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    react-scripts: ^5.0.0 => 5.0.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Create a new create-react-app using the typescript template. npx create-react-app my-app --template typescript
  2. Add a type error to src/App.test.tsx
  3. run npm run build

Expected behavior

Type errors should be ignored in test files when running or building app code.

Actual behavior

Type errors are reported in test files when running or building app code.

Reproducible demo

https://github.com/jwalton9/cra-test-type-error

Assignee
Assign to
Time tracking