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
  • #9373
Closed
Open
Issue created Jul 27, 2020 by Administrator@rootContributor

CRA does not check for presence of emitDeclarationOnly in tsconfig

Created by: squidsoup

Describe the bug

I maintain a react component library, written in TypeScript. Our components use sass, and consequently we build the library using babel rather than tsc, and use tsc for generating type declarations with emitDeclarationOnly: true.

We do want to continue using CRA, however every time we touch react-scripts it adds noEmit: true to our .tsconfig which is incompatible with emitDeclarationOnly. Please note that these two keywords are incompatible with each other, settings noEmit: false is not a solution, and this is overwritten by react-scripts to true at any rate.

This makes CRA largely unusable for maintaining a TypeScript component library unfortunately.

Originally posted as a discussion.

Did you try recovering your dependencies?

n/a

Which terms did you search for in User Guide?

n/a

Environment

n/a

Steps to reproduce

  1. Set emitDeclarationOnly: true in .tsconfig.
  2. Run a yarn script that uses react-scripts e.g. yarn test

Expected behavior

noEmit should not be added if emitDeclarationOnly is present.

Actual behavior

noEmit: true is added to .tsconfig, breaking the build.

Reproducible demo

n/a

Assignee
Assign to
Time tracking