question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax error - IE10 - Polyfill - Development Mode

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

No, it’s a fresh project.

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

Environment Info:

System: OS: Windows 10 CPU: (8) x64 Intel® Core™ i7-2600K CPU @ 3.40GHz Binaries: Node: 10.15.3 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 42.17134.1.0 Internet Explorer: 11.0.17134.1 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:)

  1. Create a new project with npx create-react-app my-app
  2. I need ie10 compatibility so do: npm install react-app-polyfill
  3. Include these 2 lines at the top in index.js: import ‘react-app-polyfill/ie9’; import ‘react-app-polyfill/stable’;
  4. Add “ie 10” to browserslist both for production and development
  5. Save + npm start.

Expected Behavior

I would see the react svg logo and the default text and background color in IE10, with no script error in IE’s dev tools console.

Actual Behavior

IE displays a blank white page with some Javascript errors in the console (attached screenshot). A “Map is undefined” error appear in ansi-colors index.js node_modules. I follow all the steps of #6924 but it doesn’t work for ie10.

Capture d’écran (46) Capture d’écran (44)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ianschmitzcommented, May 12, 2019

Ah i think i figured out what’s happengin @amerej. The error overlay unfortunately doesn’t work in browsers older than ie 11 currently it appears. The error overlay code loads before your application code, so your attempts to polyfill won’t work. This is a known issue. I’m going to close this in favor of the existing issue.

By the way, just a heads up that our default production browserslist includes not dead, which will exclude ie 10 if you were to add it before not dead in the list. You can see what i mean here: https://browserl.ist/?q=ie+9%2C+ie+10%2C+ie+11%2C+not+dead. Adding it after should work as expected though: https://browserl.ist/?q=ie+9%2C+ie+11%2C+not+dead%2C+ie+10

0reactions
amerejcommented, May 13, 2019

@ianschmitz it works!, Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React, WebPack and Babel for Internet Explorer 10 and below ...
A had 2.9.1 version installed and downgraded as you suggested and it now works on IE10. Only breaking in IE9 throwing 'set is...
Read more >
IE11 and the Missing Polyfills - DEV Community ‍ ‍
So IE11 is the minumum requirement, a vast majority of sites are designed to work with. But what if I am using IE10,...
Read more >
Syntax error 'SCRIPT1002' using internet explorer 11
First google result for me has some things to try, SCRIPT1002: Syntax error - IE11 - Polyfill - Development Mode · Issue #6924 ......
Read more >
babel/preset-env
babel/preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ...
Read more >
Is your Vue app not working in IE 11? Here's how to fix it.
The main reason why your Vue app is breaking in IE11 is because the browser does not support modern JavaScript syntax. By that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found