browserslist / browserslist

🦔 Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env

Home Page:https://browsersl.ist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

browserslist is failing to build on production with react 17

gaurav1992 opened this issue · comments

I am keep getting this error while production build. I am using

 Node:  14.20.1
 NPM : 6.14.17
 React : 17.0.1

react-scripts build

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Failed to compile.

/var/www/clientadmin/releases/20231201111619/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts
TypeScript error in /var/www/clientadmin/releases/20231201111619/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts(1,15):
',' expected. TS1005

1 | import { type Options as DetectOverflowOptions } from '../detectOverflow';
| ^
2 | import type { Alignment, Derivable, Middleware, Placement } from '../types';
3 | export declare function getPlacementList(alignment: Alignment | null, autoAlignment: boolean, allowedPlacements: Array): Placement[];
4 | export type AutoPlacementOptions = Partial<DetectOverflowOptions & {

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adminwebuserid@0.9.137 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the adminwebuserid@0.9.137 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2023-12-01T11_20_54_874Z-debug.log

I have tried this command as suggested npx browserslist@latest --update-db but i am still getting the same error.

Any help would be much appricated.

In you post there are 2 different messages:

  1. Warning from Browserlist
  2. TS error from autoPlacement.d.ts which is the reason of falling

So your problem is not because of Browserslist