-
-
Notifications
You must be signed in to change notification settings - Fork 27k
SCRIPT1002: Syntax error - IE11 - Polyfill - Development Mode #6924
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
Comments
the same issue |
You'll want to take a look at the 3.0 release notes. Likely you'll need to adjust your |
@ianschmitz Can you give me the exact steps to do this? I tried it once already before I made this bug ticket and it didn't work, want to make sure I'm not doing it wrong. Went to package.json and under the development section for Browserslist I tried adding these (not all at the same time, one at a time to try and find one that worked) : |
Try deleting your node_modules folder after making the change as I believe I've experienced Babel caching not detecting the new values |
Alright It'll take some time to test this since I have to spin up a docker VM here at home. I'll get back as soon as I find out if it worked. |
Adding IE to CRA 3.0 in browserlist doesn't work. |
@ianschmitz was correct. deleting node_modules worked.
I'll post an updated dockerfile in case anyone is interested in it shortly once I get it working |
@ianschmitz , adding "ie 11" browserslist partially solves the problem, now this error apears on arrow function, previously everything worked with babel-polyfill |
as temporary resolution this issue I just remove node_modules and replaced package-lock.json and package.json from workin project and |
Did you add the polyfills ontop of your index.js file? (or your projects equivalent) |
Those first 2 lines in my index.js are required for using create-react-app with IE11 now.
As noted here in the release notes for v2.0.5: |
This is the docker solution that worked for me. To anyone else who wants to try this solution there are a couple of caveats.
Dockerfile:
Docker-compose:
index.js
Package.json:
|
For a non docker solution:
|
Glad to hear it worked. The default Here is a handy tool to see the result: https://browserl.ist/?q=%3E0.2%25%2C+not+dead%2C+not+op_mini+all. The |
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes. I am using docker and have re-built my container multiple times.
I have also tried using a previous version of react-scripts / create-react-app
npm --version
output: 6.9.0
Which terms did you search for in User Guide?
Searched For: IE11, Syntax Error, Script1002, Polyfill.
I followed the guide for adding polyfills using react-app-polyfill.
The first two lines in my index.js file are
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
I have tried with & without stable.
I have tried with ie11 & ie9 polyfills.
Environment
System:
OS: Linux 3.10 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
Binaries:
Node: 12.0.0 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: 3.0.0 => 3.0.0
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
Expected Behavior
My app should work on internet explorer 11 in the same manner it works in chrome
Actual Behavior
I'll put the specific details here.
The app i've been working on for a year or so with create-react-app stopped working in IE11 when I updated it yesterday.
To ensure that it was not my own code that broke IE11 support, I spun up a brand-new copy of create-react-app to test and it still did not work on IE11.
I followed the steps for react-app-polyfill and that still did not work on IE11.
I have tried to force NPM to install a previous version of react-scripts/create-react app using
npm i [email protected] but that doesn't work.
(Note: 2.0.5 is the last version i was on when I had a container working perfectly on IE11 5 months ago.)
{Edit} when i try installing this past version, I check the package.json and it says react-scripts is at version 3.0.0 despite specifying 2.0.5
Index.js

Website On Chrome:

Website on IE11:



Reproducible Demo
Here is the dockerfile I use to boot up this container:
Here is the docker-compose file I'm using:
To build your own demo environment to test this for yourself, the steps are as follows:
(this is going to assume you know some docker basics. Otherwise you can install create-react-app normally and test it that way)
The text was updated successfully, but these errors were encountered: