I have react app that used bootstrap 4.3.1 as node modules.When i am building the app its giving below error TypeScript error in /codebuild/output/src478180495/src/app-name/node_modules/@popperjs/core/lib/createPopper.d.ts(1,13): '=' expected. TS1005 > 1 | import type { OptionsGeneric, Modifier, Instance, VirtualElement } from "./types";
It was fine earlier. error coming up today.
React app build failed for popper js typescript error
9.7k views Asked by DIPESH NAYAK At
2
There are 2 answers
0
On
I ran into same problem while coding a web part for SPFx, which is slightly different, but since search led me here, so I'll leave the answer for anyone in the future.
while updated typescript to 4.4 when running gulp serve
i got typescript version: 3.7.7
. Steps to remedy:
- run
npm i @microsoft/rush-stack-compiler-3.9
This variant selects TypeScript 3.9 - in
tsconfig.json
changeextends
to"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
- in
tslint.json
remove"no-use-before-declare": true,
as it will cause errorError - [tslint] no-use-before-declare is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
It is due to a new syntax introduced by Typescript type-only-imports-and-export
Upgrade your
typescript
module inpackage.json
to > 3.8.0 and@type
definitions should solve this issue.Heres the related Stackoverflow topic.