Import issues in latest version (25.2.0)
See original GitHub issue💥 Regression Report
Doing an npm i shows the import errors:
tsc -b . …/node_modules/jest-diff/build/diffLines.d.ts:8:13 - error TS1005: ‘=’ expected. 8 import type { DiffOptions } from ‘./types’; ~…/node_modules/jest-diff/build/diffLines.d.ts:8:34 - error TS1005: ‘;’ expected. 8 import type { DiffOptions } from ‘./types’; ~~~~~~~~~ …/node_modules/jest-diff/build/index.d.ts:10:13 - error TS1005: ‘=’ expected. 10 import type { DiffOptions } from ‘./types’; ~ …/node_modules/jest-diff/build/index.d.ts:10:34 - error TS1005: ‘;’ expected. 10 import type { DiffOptions } from ‘./types’; ~~~~~~~~~ …/node_modules/jest-diff/build/index.d.ts:11:1 - error TS1128: Declaration or statement expected. 11 export type { DiffOptions, DiffOptionsColor } from ‘./types’;
Last working version
25.1.0
Stopped working in version:
25.2.0
To Reproduce
just do a npm i
Steps to reproduce the behavior:
just do a npm i
Expected behavior
A clear and concise description of what you expected to happen.
jest -diff installs without any issues whatsoever
Link to repl or repo (highly encouraged)
Please provide either a repl.it demo or a minimal repository on GitHub.
Issues without a reproduction link are likely to stall.
Run npx envinfo --preset jest
Paste the results here:
npx: installed 1 in 3.108s
System:
OS: Windows 10 10.0.18363
CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
Binaries:
Node: 12.4.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.7 - C:\Program Files\nodejs\npm.CMD
Issue Analytics
- State:
- Created 3 years ago
- Reactions:19
- Comments:25

Top Related StackOverflow Question
It looks like you need typescript > 3.8.0 as support was just recently added - https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-rc/
Also referenced here - https://github.com/facebook/create-react-app/issues/8714
Installing typescript latest or at least v3.8.2 will fix it.
I’m experiencing this problem with typescript 4.0.5 and jest 26.4.2: