node と yarn の最新バージョンを使用するようにプロジェクトを更新しました。このアップグレード後、react プロジェクトは「browserslist」で動作しなくなりました。
「yarn start」を実行すると、次のエラーが発生します。
./src/assets/css/material-dashboard-react.css?v=1.2.0 (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/assets/css/material-dashboard-react.css?v=1.2.0)
BrowserslistError: Unknown browser kaios
at Array.reduce (<anonymous>)
at Array.some (<anonymous>)
at Array.filter (<anonymous>)
at new Promise (<anonymous>)
次のバージョンがあります。
- ノード v10.15.3
- npm 6.9.0
- 糸 v1.15.2
そして私のpackage.jsonは
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "3.9.3",
"@material-ui/icons": "3.0.2",
"axios": "0.18.0",
"classnames": "2.2.6",
"html2canvas": "^1.0.0-alpha.12",
"immutable": "3.8.2",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"moment": "2.22.2",
"npm-run-all": "4.1.5",
"perfect-scrollbar": "1.4.0",
"plotly.js": "1.47.1",
"react": "^16.6.3",
"react-currency-format": "1.0.0",
"react-dates": "18.2.2",
"react-dom": "^16.6.3",
"react-excel-workbook": "0.0.4",
"react-google-maps": "9.4.5",
"react-plotly.js": "2.3.0",
"react-redux": "6.0.0",
"react-router": "4.3.1",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.8",
"react-select": "2.1.2",
"react-swipeable-views": "0.13.1",
"redux": "4.0.1",
"redux-immutable": "4.0.0",
"redux-persist": "5.10.0",
"redux-thunk": "2.3.0",
"weather-icons": "^1.3.2"
},
"scripts": {
"start": "react-scripts --max-old-space-size=8192 start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": [
">1%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
私にとっては、css-loader に関連する問題です。問題を解決して、package.json に css-loader@2.1.1 を追加してみます。私は他の解決策を試しますが、誰もうまくいきません。