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

issue: Cannot submit form in React Native #9713

Closed
1 task done
dexterowy opened this issue Jan 4, 2023 · 9 comments
Closed
1 task done

issue: Cannot submit form in React Native #9713

dexterowy opened this issue Jan 4, 2023 · 9 comments
Labels
regression Regression with code change

Comments

@dexterowy
Copy link

Version Number

7.41.4

Codesandbox/Expo snack

https://snack.expo.dev/q7vrP6Y-1

Steps to reproduce

  1. Submit form
  2. See error

Expected behaviour

onSubmit function should be invoked

What browsers are you seeing the problem on?

No response

Relevant log output

Possible Unhandled Promise Rejection (id: 3):
ReferenceError: Property 'HTMLElement' doesn't exist
ReferenceError: Property 'HTMLElement' doesn't exist
    at te (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:106884:77)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:106974:54)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20527:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20546:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20551:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20543:25)
    at apply (native)
    at fe (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:107051:27)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:107372:33)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20527:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20546:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20551:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20543:25)
    at apply (native)
    at P (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:107382:29)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:107756:29)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20527:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20546:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20551:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:20543:25)
    at apply (native)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:107774:32)
    at _performTransitionSideEffects (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:74392:22)
    at _receiveSignal (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:74348:45)
    at onResponderRelease (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:74215:34)
    at apply (native)
    at invokeGuardedCallbackProd (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2894:21)
    at apply (native)
    at invokeGuardedCallback (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2980:42)
    at apply (native)
    at invokeGuardedCallbackAndCatchFirstError (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2983:36)
    at executeDispatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:3047:48)
    at executeDispatchesInOrder (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:3064:26)
    at executeDispatchesAndRelease (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4170:35)
    at executeDispatchesAndReleaseTopLevel (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4177:43)
    at forEach (native)
    at forEachAccumulated (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:3506:22)
    at runEventsInBatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4188:27)
    at runExtractedPluginEventsInBatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4247:25)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4228:42)
    at batchedUpdates$1 (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:14785:20)
    at batchedUpdates (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4159:36)
    at _receiveRootNodeIDEvent (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4227:23)
    at receiveTouches (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:4270:34)
    at apply (native)
    at __callFunction (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2433:36)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2195:31)
    at __guard (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2385:15)
    at callFunctionReturnFlushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.PhotoSpot:2194:21)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added the question Further information is requested label Jan 4, 2023
@dexterowy
Copy link
Author

dexterowy commented Jan 4, 2023

Didn't help, still the same error.

I've just created new app with only react-hook-form installed and copy-paste code from docs for react native.
Getting the same error.

@bluebill1049
Copy link
Member

Screen.Recording.2023-01-04.at.12.43.09.pm.mov

@Moshyfawn
Copy link
Member

Moshyfawn commented Jan 4, 2023

Screen.Recording.2023-01-04.at.12.43.09.pm.mov

You are running the Snack in the browser, @bluebill1049

@Moshyfawn
Copy link
Member

Moshyfawn commented Jan 4, 2023

It looks like it's failing on native platforms (no Document) here

@dexterowy
Copy link
Author

It's possible.

I switched to react-hook-form@7.40.0 and worked

@bluebill1049
Copy link
Member

Thanks for the update, i think i know the root cause.

@bluebill1049 bluebill1049 added regression Regression with code change and removed question Further information is requested labels Jan 4, 2023
@bluebill1049
Copy link
Member

react-hook-form@7.41.8-beta.0 @dexterowy could you also verify this beta version?

@dexterowy
Copy link
Author

dexterowy commented Jan 4, 2023

Works great. Thank you, for quick fixes

@bluebill1049
Copy link
Member

thanks for the report and verify, release the patch now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Regression with code change
Projects
None yet
Development

No branches or pull requests

3 participants