Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Right-hand side of 'instanceof' is not an object (FileList) #494

Closed
Newbie012 opened this issue Jun 6, 2022 · 3 comments · Fixed by #675
Closed

TypeError: Right-hand side of 'instanceof' is not an object (FileList) #494

Newbie012 opened this issue Jun 6, 2022 · 3 comments · Fixed by #675
Assignees
Labels
enhancement New feature or request

Comments

@Newbie012
Copy link

Newbie012 commented Jun 6, 2022

I'm getting the following error:

TypeError: Right-hand side of 'instanceof' is not an object
 ❯ cloneObject file:/home/.../node_modules/.pnpm/react-hook-form@7.31.3_react@18.1.0/node_modules/react-hook-form/dist/index.esm.mjs:574:55
 ❯ createFormControl file:/home/.../node_modules/.pnpm/react-hook-form@7.31.3_react@18.1.0/node_modules/react-hook-form/dist/index.esm.mjs:1347:26
 ❯ Module.useForm file:/home/.../node_modules/.pnpm/react-hook-form@7.31.3_react@18.1.0/node_modules/react-hook-form/dist/index.esm.mjs:2203:16

which points to the following line in react-hook-form:

!(isWeb && (data instanceof Blob || data instanceof FileList)) &&

It looks like FileList is being evaluated as undefined.

@capricorn86 capricorn86 added the enhancement New feature or request label Jun 8, 2022
@capricorn86
Copy link
Owner

Yes, we need to add support for FileList.

@josteph
Copy link

josteph commented Jul 8, 2022

Got an error while using in React environment, it's pointing to this line: https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-dom/src/client/ReactInputSelection.js#L62

@capricorn86 capricorn86 self-assigned this Dec 7, 2022
@capricorn86 capricorn86 linked a pull request Dec 7, 2022 that will close this issue
capricorn86 added a commit that referenced this issue Dec 7, 2022
…d-side-of-instanceof-is-not-an-object-filelist

#494@minor: Adds support for FileList to HTMLInputElement.
@capricorn86
Copy link
Owner

@Newbie012 @josteph There is now a fix in an adds support for FileList 🙂

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants