reactjstypescriptpopperjs

React app build failed for popper js typescript error


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.


Solution

  • It is due to a new syntax introduced by Typescript type-only-imports-and-export

    Upgrade your typescript module in package.json to > 3.8.0 and @type definitions should solve this issue.

    Heres the related Stackoverflow topic.