react-hook-form: Bug report: Cannot resolve dependency 'ts-polyfill/es2015-symbol' since v4.9.4

Describe the bug After updating to 4.9.4 I immediatelly get this error on console:

Γ—  [project_root]\node_modules\react-hook-form\dist\react-hook-form.ie11.js:7:8: Cannot resolve dependency 'ts-polyfill/es2015-symbol'
   5 | require('ts-polyfill');
   6 | require('ts-polyfill/es2015-iterable');
>  7 | require('ts-polyfill/es2015-symbol');
     |        ^
   8 | require('ts-polyfill/es2015-symbol-wellknown');
   9 | var React = require('react');
  10 |

Additional context In my project I use the ie11 version of react-hook-form. This issue is probably related to the latest PR #1018

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (13 by maintainers)

Most upvoted comments

I agree too πŸ˜ƒ

Also allow ts-polyfill to be included in the bundle

hey @kotarella1110 we will not ship the lib with ts-polyfill bundle, i think we are better leave those to explain in the documentation. I will revert the commit tonight if i don’t hear from @vova-bezhenar

@bluebill1049 I agree with you πŸ‘

I think the following lines need to be fixed.

https://github.com/react-hook-form/react-hook-form/blob/master/src/index.ie11.ts#L1-L4

import 'ts-polyfill';
import 'ts-polyfill/lib/es2015-iterable';
import 'ts-polyfill/lib/es2015-symbol';
import 'ts-polyfill/lib/es2015-symbol-wellknown';

Also, we need to install ts-polyfill to use ie11 version of react-hook-form. If we want to bundle with ts-polyfill, we should remove it from external in rollup config.

https://github.com/react-hook-form/react-hook-form/blob/master/rollup.ie11.config.js#L14