convoyinc / apollo-cache-hermes

A cache implementation for Apollo Client, tuned for performance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work with create-react-app with Typescript

mattias800 opened this issue · comments

Summary:
create-react-app now supports Typescript, using Babel 7.
It uses --isolatedModules though, which does not work with const enums.

Simply changing from const enum to enum should work.

Expected Behavior:

A simple CRA project should compile correctly.

Actual Behavior:

/app/node_modules/apollo-cache-hermes/src/schema.d.ts
Type error: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.  TS1209

    91 |      *
    92 |      */
  > 93 |     const enum NodeSnapshotType {
       |                ^
    94 |         EntitySnapshot = 0,
    95 |         ParameterizedValueSnapshot = 1,
    96 |     }