# React 支援舊版本瀏覽器問題 ###### tags: `React` `debug` `browser` 不知道多舊版的 win chrome 出現的錯誤: :::danger TypeError: Object.entries is not a function ::: 遇到版本問題第一個想法就是 `polyfill` 查了一下 React polyfill 套件: `react-app-polyfill`,使用 `create-react-app` 安裝的裡面就有含了 ### step.1 `package.json` 新增 `'ie 11'` ``` "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all", "ie 11" >>> 多加 ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version", "ie 11" >>> 多加 ] } ``` ### step.2 `index.js` 入口檔案最上層加上 ``` import 'react-app-polyfill/ie11' import 'react-app-polyfill/stable' ``` 目前還沒遇到 IE 死掉的狀況 只有測到舊版 chrome,然後以上兩步驟加完也正常了 ### 線上舊版 win chrome 載點 [點我GO](https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2F389347%2Fmini_installer.exe?generation=1461381229389000&alt=media) ### Reference: https://stackoverflow.com/questions/59834690/react-app-polyfill-doesnt-work-in-ie11 https://dotblogs.com.tw/wasichris/2019/06/20/234252 https://github.com/facebook/create-react-app/issues/8195 https://create-react-app.dev/docs/supported-browsers-features/#configuring-supported-browsers
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up