Fresh install fails to compile
AdamScura opened this issue · 2 comments
AdamScura commented
npm start fails to compile
Repro:
- clone repo
- open folder in vscode
- npm install
- npm start
- observe failure message
Terminal output from npm start
> rsk-github-issues-example@0.1.0 start D:\Dev\rtk-github-issues-example
> react-scripts start
�[34mi�[39m �[90m「wds」�[39m: Project is running at http://0.0.0.0:3000/
�[34mi�[39m �[90m「wds」�[39m: webpack output is served from
�[34mi�[39m �[90m「wds」�[39m: Content not from webpack is served from D:\Dev\rtk-github-issues-example\public
�[34mi�[39m �[90m「wds」�[39m: 404s will fallback to /
Starting the development server...
Failed to compile.
D:/Dev/rtk-github-issues-example/node_modules/jest-diff/build/diffLines.d.ts
TypeScript error in D:/Dev/rtk-github-issues-example/node_modules/jest-diff/build/diffLines.d.ts(8,13):
'=' expected. TS1005
6 | */
7 | import { Diff } from './cleanupSemantic';
> 8 | import type { DiffOptions } from './types';
| ^
9 | export declare const diffLinesUnified: (aLines: string[], bLines: string[], options?: DiffOptions | undefined) => string;
10 | export declare const diffLinesUnified2: (aLinesDisplay: string[], bLinesDisplay: string[], aLinesCompare: string[], bLinesCompare: string[], options?: DiffOptions | undefined) => string;
11 | export declare const diffLinesRaw: (aLines: string[], bLines: string[]) => Diff[];
I did some quick research and it seems to be related to this issue: https://stackoverflow.com/questions/59833120/parsing-error-expected-in-import-type
I'm guessing the latest version of jest is using a feature that is not fully supported by the typescript compiler. This commit was released 12 hours ago: jestjs/jest@4a59daa#diff-8b6cd0ec8c11f6c2366c3527788d8fe8
AdamScura commented
Yeah, these issues popped up today:
afzalhussain23 commented
Upgrade @types/jest
version to 25.2.1
to solve this error.