0

When I'm start my app in IE11 I get blank page with two errors

SCRIPT438: Object doesn't support property or method 'contains'

SCRIPT438: Object doesn't support property or method 'repeat'

Can't find something that I can use to fix the errors.

I using useForm on Three Radio buttons with the same id in the register .

When I comment two the page Display good, but when I uncomment the rest its give me the errors(maybe because its have the same id)

my Radio comp(there two more, they look the same)

<E.Box bgColor={"#19AADD"}>
              <RadioButton
                svg={<HovaSvg />}
                bgColor={"#19AADD"}
                name={"chooseInsurance"}
                label={t.INSURANCE_ONLY_HOVA}
                font={true}
                whiteSpace={true}
                tabIndex={"0"}
                setvaluefunc={setValue}
                register={{
                  ...register("chooseInsurance", { required: true }),
                }}
              ></RadioButton>
            </E.Box>

my Index file

import "react-app-polyfill/ie11";
import "react-app-polyfill/stable";
import "proxy-polyfill/proxy.min.js";
import "core-js/features/string/repeat";
import "core-js/stable";

import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { BrowserRouter } from "react-router-dom";

ReactDOM.render(
  <BrowserRouter>
    <App />
  </BrowserRouter>,
  document.getElementById("root")
);
  • Does this answer your question? [SCRIPT438: Object doesn't support property or method IE](https://stackoverflow.com/questions/13975922/script438-object-doesnt-support-property-or-method-ie) – User7007 Oct 21 '21 at 08:43
  • hey, I saw this . but my radio buttons its three options and the user need to choose one of them. changing the id its not helping because the data will not be correct –  Oct 21 '21 at 08:47
  • The radio buttons should have the same name not the same id. What about change them to same name and unique ids? Besides, for the errors you get, you can refer to [this thread](https://stackoverflow.com/questions/57606743/ie11-object-doesnt-support-property-or-method-contains) and [this thread](https://stackoverflow.com/questions/62702664/using-react-polyfills-but-getting-error-object-doesnt-support-property-or-metho?rq=1). IE 11 doesn't support `contains()` and `repeat()`, you can use polyfills to fix the issue. – Yu Zhou Oct 22 '21 at 05:25
  • @YuZhou how I can you polyfills? –  Oct 24 '21 at 06:55
  • In the answers of the two threads I mentioned in my comment, you can find how to apply the polyfills. Please click the thread links and try to apply the polyfills like the answers show. – Yu Zhou Oct 25 '21 at 07:00
  • solved the problem with global state and if conditions . –  Oct 25 '21 at 14:24
  • I'm glad that you have solved the issue. You can post your solution as an answer and mark your answer as an accepted answer. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Yu Zhou Oct 27 '21 at 01:39

0 Answers0