resolvers: Failed to parse source map + IE11
Running latest version 1.0.0 I get these complications:
Failed to parse source map …/node_modules/@hookform/resolvers/src/yup.ts’ file: Error: ENOENT: no such file or directory, open ‘…/react-app/node_modules/@hookform/resolvers/src/yup.ts’
Also can you provide example of how using it with IE11 in documentation? Should it be like this?
import { yupResolver } from '@hookform/resolvers/dist/ie11/yup';
When using it with IE11 I get this:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 34 (15 by maintainers)
Okay so I have a solution which might work. I’ll open a pull request and @bluebill1049 will make a test release for you 😃
I’ll look into this issue 🕵🏻♂️
@c0d3x You can find a little example at Browser Supports section in FAQs page
Thanks very much for @jorisre 's contribution ❤️
I added this to my types-overrides file (type-overrides.d.ts), was that what you ment? and yes it seems to work now. 👍🏼 For RHF, it has a type file as a reference index.ie11.d.ts file in same path, so it resolves it automatically without need to add anything to my type-overrides.d.ts file.
This version works in my IE11 setup.
@c0d3x @jrolfs here is a beta version
@hookform/resolvers@1.0.1-beta.1
Ah, that’s great news @jorisre — I really wanted to help out but time constraints have me moving forward with https://github.com/ds300/patch-package for the moment. I will readily test any RC’s though 😄!
@c0d3x quick thought: you may be able to workaround this by pinning to v0.1.1 and following the directions in this PR: https://github.com/react-hook-form/resolvers/pull/48.
Sadly having to scramble to support IE11 for a client and I’m running into this as well. I’m seeing the same thing as @c0d3x (the
ie11
bundle importsreact-hook-form
instead ofreact-hook-form/dist/index.ie11
).At first glance I suspect this https://github.com/react-hook-form/resolvers/pull/48 wasn’t properly ported over into the new entry point build. I’ll be continuing on this tomorrow and will pull this repo down and hack at the Rollup config/build a bit to see if I can’t get a PR up.
@jorisre
Looks like it might be because of this import that the hookform is doing, relying on this ESM non IE11 lib.
@jorisre Yes, I will try to reproduce the error setting up a TS project. Will get back to you soon 👍🏼
Thanks, heaps for looking into this @jorisre
Hi @c0d3x !
Here is a working example with @hookform/resolvers ie11 https://github.com/jorisre/hookform-resolvers-ie11-example
To make it works, be sure:
@c0d3x 👋🏻 !
I’m Working on it 😃
The map error I get when running the application.
The IE11 bug I get when opening the app, it crashes the entire app and refers to the HTMLElement. When I uncomment the resolver import (import { yupResolver } from ‘@hookform/resolvers/dist/ie11/yup’;) and reference in useForm(), then the app works fine.
SCRIPT1002: Syntax error