0

I have many React applications that works in Internet Explorer 11 (With polyfills). I would like to use TypeScript in my next applications, so I developed my first one using the same technologies and concepts from the other apps. The problem is that I can just see a blank page in that browser, and many errors (Translated from Spanish):

Invalid range in character set.

Object does not accept 'repeat' property or method (This one appears 26 times).

This is my package.json:

{
  "name": "reportes",
  "homepage": "http://localhost:8080/isset/view/funeraria/reportes",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.9.8",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.47",
    "@mdi/js": "^5.0.45",
    "@mdi/react": "^1.4.0",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@types/jest": "^24.0.0",
    "@types/node": "^12.0.0",
    "@types/react": "^16.9.0",
    "@types/react-dom": "^16.9.0",
    "@types/react-router-dom": "^5.1.3",
    "axios": "^0.19.2",
    "core-js": "^3.6.5",
    "exceljs": "^3.8.2",
    "file-saver": "^2.0.2",
    "moment": "^2.24.0",
    "react": "^16.13.1",
    "react-app-polyfill": "^1.0.6",
    "react-dom": "^16.13.1",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.4.1",
    "react-select": "^3.1.0",
    "react-to-print": "^2.6.3",
    "typescript": "~3.7.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "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"
    ]
  }
}

And I have this imports at my index.tsx:

import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';

Can you help me to fix this?

1

1 Answer 1

0

repeat is not supported by IE. You need to add polyfill for it.

For the other errors, you could also check if you used some syntax not supported by IE and try to find the polyfills for them or use some transpiler such as Babel. You could also refer to this thread.

Besides, please add import 'react-app-polyfill/ie11'; import 'react-app-polyfill/stable'; at the first line of your src/index.tsx.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.