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 best solutions below
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.9This variant selects TypeScript 3.9 - in
tsconfig.jsonchangeextendsto"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json", - in
tslint.jsonremove"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
typescriptmodule inpackage.jsonto > 3.8.0 and@typedefinitions should solve this issue.Heres the related Stackoverflow topic.