react-hook-form: IE11 problem in v6.7.0
Thank you for answering #2468 the other day. I have found a problem in IE11 again, so I will report it.
Describe the bug
When I was using React Hook Form v6.7.0 with IE11, I got some errors as shown in the screenshot.
Also I installed @babel/runtime-corejs3 with reference to FAQs.
I think it was caused by changing the rollup settings in v6.5.1 -> v.6.5.2, but I’m not sure.
To Reproduce
- Build the following code(Production or Debug Build) and run it with IE11.
- Enter some characters in the form and click “Submit”(If you can’t reproduce it, please reload a few times).
- Get some error messages and the form does not work fine.
Specifically, after pressing The “Submit” button, the next process is not executed.
I have found this problem both Production Build and Debug Build.
Codesandbox link (Required) I share my repository because it’s difficult for Codesandbox to reproduce with IE11.
https://github.com/kwht-k/rhf670-ie11-reproduction
Expected behavior The error message disappear and my code works fine in IE11.
Screenshots

Desktop (please complete the following information):
OS: Windows10 Pro 64bit Browser: Internet Explorer 11 (11.1016.18362.0) Version of React Hook Form: 6.7.0 Version of @babel/runtime-corejs3: 7.11.2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (22 by maintainers)
we can probably can include more as we go…
Thanks @bluebill1049 .
But I’m not sure only
Object.valuesandObject.entriesare necessary. There may be others.oops forgot to push, it’s updating now… 😃 https://github.com/react-hook-form/documentation/commit/2f64faf524cac3e3f1e511a90c0e60446884e766
@bluebill1049 @yhor1e Thank you so much for supporting to this issue🙇♂️ I also think the added description is very good.
here is what will be included in the doc.
@bluebill1049
I think the document will be better to explain which polyfills are necessary, like below.
Object.valuesObject.entriesI want to avoid importing the whole polyfill like
import 'react-app-polyfill/stable';Amazing! thank you. your name is in the repo now 😃
Thanks @vutoan266 for sharing the solution.
Not relative to IE11 but I have a problem with safari on ios11. It lacks
Array.polyfill.flat(). Here is the polyfill I get from https://stackoverflow.com/questions/56468914/ie11-attempt-to-use-the-method-flat-polyfill-causes-error-within-the-polyfill/56501391Thanks very much for your help @yhor1e ❤️
LGTM!! 💯
Thanks @bluebill1049 .
Thanks very much for the finding and investigation!
That’s correct @kotarella1110 made this change, hmmm perhaps we will have to ask users to include polyfills? (include them in the doc) otherwise, it does make this build rather complicated.
@bluebill1049
I think React Hook Form is transpiled for IE11 by Typescript without Bable or core-js now.
Refs:
But I’m afraid the Typescript option
"target": "es5"is not enough for IE11.I tried to transpile a sample code using
Object.valuesby Typescript. I created objectValues.ts.Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Object/values
And I ran below command.
Then I got objectValues.js. But it doesn’t include any polyfills.
Thank you for your time @bluebill1049.
I got it. I’ll report if I notice anything.
Thanks, @yhor1e for the feedback. It’s going to be tricky for me, as I am not a windows user, yes I can spin up a virtual machine but it would be great if you can provide me some insight, consider we are already using babel to transpile the project and dedicated IE build, we can potentially investigate there.
IE 11! @kotarella1110 sorry to tag you again, looks like this IE is never-ending…