-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE11 support doesn't work in dev mode, even after adding all polyfills and enabling ie11 support #8197
Comments
@ttaranov Can you please be more specific about the error in IE? when the SyntaxError is thrown you should be able to see exactly what has failed. For Example 'xxx is undefined' or 'cannot read xxx of undefined' etc. This will help everyone to understand exactly what you're missing from the polyfills. I had the same issue in dev and prod with TextEncoder.
However we wouldn't know what exactly is missing in your case. You will need to be more specific about the error |
I'm able to reproduce. It looks like the syntax errors are from arrow functions, which ie11 doesn't support. Babel's preset-env and that browserslist configuration should handle transforming arrow functions to regular functions, but that apparently isn't working right. IE11 has sourcemap support, so this is from actually checking the network tab for the location of the syntax error. |
I confirm the bug, just a small note that version |
This comment has been minimized.
This comment has been minimized.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Just ran into this issue as well. Even 3.2.0 does not work for me. Have added polyfill, have added ie11 to browserlist in package.json. Syntax error is thrown at first fat arrow function. |
Same problem here, related to #8546? |
Same problem, any updates about this? Thanks |
Same here with react-scripts@3.4.1 The production build works but the dev build is not. |
Running into the same issue. Prod is fine but dev is completely broken. |
seam issue, 3.2.0 doesnt work for me, Could someone help me? |
Same here. Tried 3.2.0 as suggested but no luck. |
Same issue, react-scripts-3.3.1, dev build doesn't load production build does. |
After trying a lot of things I go back to 3.4,1 again and cleared my node_modules and reinstalled. Finally got it working in dev with workaround from @J-theGit
"react-app-polyfill" version installed is 1.0.5 and the fast-text-encoding is 1.0.1 |
Can you outline the workaround? |
I have a working solution (development) with react-scripts v. 3.4.1. this my package.json:
this is my index.tsx (note that the polyfills are at the very beginning):
|
Clearing the cache and then starting the app worked for me:
|
still |
I am having a similar issue but with bundle.js and arrow functions in IE11. I have asked the question here https://stackoverflow.com/questions/62130921/react-app-bable-polyfill-not-working-correctly-ie11 too to see if anyone has a resolution to this. |
I have IE11 issues even after creating a new project so I dont think its down to an external library in my case |
After adding index.js
package.json
|
Looking at Rollbar errors for the latest front-end version made me realize that there were arrow functions in our JS bundles. Upon further inspection, I realized our `browserslist` specifies `not ie <= 11`, yet our `index.js` imports both `react-app-polyfill/ie11` and `babel-polyfill`. These contradictory lines were actually all introduced in the same PR, #99, which is very odd. I think the reason we might not have seen this strange behavior when writing that PR is because apparently [changing `browserslist` requires deleting `node_modules/.cache`][1]. So it's possible that during development, we never truly saw the results of our actions! (Needless to say, I spent a lot of time in confusion after making this PR's simple code change, until I discovered the root cause.) This means that even Netlify won't reflect changes to `browserslist` by default (it caches all of `node_modules` between builds), so I've modified its configuration to clear `node_modules/.cache` before building the site too. [1]: facebook/create-react-app#8197 (comment)
From https://stackoverflow.com/questions/62130921/react-app-bable-polyfill-not-working-correctly-ie11 I got the solution to fix my problem. react-scripts: 3.4.3 Attach
to the first line of package.json "browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all",
"not ie < 11",
"ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"ie 11"
]
}, Once I added |
My problem resolved.
It works! 👍 |
Deprecated in package.json file, ran npm install, for React-scripts to "3.4.3" from "4.0.1" on which version the above issue was occurring. Along with polyfill/ie11 and polyfill/stable, .cache folder deletion and browserlists.development changes. Site showed up on IE. |
IE 10/11 was failing on my project because |
Describe the bug
IE11 support doesn't work even after adding react-app-polyfill, enabling "ie 11" in browserslist in package.js and adding import 'react-app-polyfill/ie11' and import 'react-app-polyfill/stable' into src/index.js
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
followed instructions on
https://create-react-app.dev/docs/supported-browsers-features/
and
https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md
Environment
MacOS
node 11.15.0
npm 6.7.0
latest create-react-app
Virtual Box with Microsoft's test Window10 and IE11 image VM
Steps to reproduce
<ip>
:3000 in IE11Expected behavior
test create react page is supposed to show up
Actual behavior
SCRIPT5022: SyntaxError
0.chunk.js (19856,1)
The text was updated successfully, but these errors were encountered: