0

I'm trying to access a basic react application that is running on my local network using IE in a windows environment. The site appears to be working on chrome, but not in IE. When I navigate to the url in IE, I only see a blank screen.

I've already tried configuring IE to include the network url in the local intranet zone, however it didn't change the outcome.

To clarify, I am runnning a react application using create-react-app and I have not made any changes yet. However when I inspected the site, I found these errors appear in IE:

SCRIPT1028: Expected identifier, string or number
bundle.js (1017,11)

SCRIPT1002: Syntax error
vendors-main.chunk.js (10,1)

SCRIPT1010: Expected identifier
main.chunk.js (57,52)

1 Answers1

0

You need to add polyfills to support React in IE 11. The default app built by CRA is not compatible with IE 11, we need to follow the steps below to make it supported in IE 11:

  1. Add <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script> in pubic\index.html.

  2. Add ie 11 in package.json browserslist:

    "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"
        ]
      }
    
  3. Delete node_modules.cache.

  4. Restart the app then it can work well in IE 11.

Besides, you can also refer to the solution in this accepted answer to support React in IE 11.

Yu Zhou
  • 11,532
  • 1
  • 8
  • 22
  • Unfortunately this solution didn't work for me. Now my site won't even load anymore, it's no longer able to connect to the network. There doesn't appear to be any error messages, but when I ran the troubleshooter, it said that the network is there but the connection is refused. – Mysterious Shadow Nov 12 '21 at 12:53
  • Is your app a new created CRA app? If not, could you please provide [a minimal code snippet](https://stackoverflow.com/help/minimal-reproducible-example) of your app and the steps to reproduce the issue, so that we can have a test and see how to help? Besides, does the solution in the link of my answer work? – Yu Zhou Nov 15 '21 at 02:55