-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
URL.searchParams.has method is broken #33336
Comments
Hi 👋, This may be related to this issue: facebook/react-native#45030 There is a opened PR related to this issue: facebook/react-native#45055 But still not merged :/ |
As explained by the OP, this is an upstream issue with a dependency that we use. I believe that we only use this within the wintercg environments (API routes, RSC, SSR, etc). Please follow the issue linked by the OP for updates. We will update the dependency when they release a new version. |
@ashxjs thanks for the reference. It seems that the support for web compatible APIs in the react-native ecosystem is indeed an issue and that URL and URLSearchParams objects are not supported neither on Hermes (also missing in jscore apparently) nor the react-native library itself. This is as mentioned by the Hermes team because URL is part of the Web APIs and not ECMAScript and Hermes is not supposed to run in Browsers. I assume that's the same rationale on the react-native team or it just doesn't have priority. This is why the community tends to go with solutions like I was trying Expo with Hermes Engine Issues
React Native Library Issues
Other react-native-url-polyfill errorscharpeni/react-native-url-polyfill#471 Maybe there should be a bigger warning when referencing this polyfill? Expo Docs (check STEP 2) includes the polyfillhttps://docs.expo.dev/guides/using-supabase/ Supabase docs (check STEP4) includes polyfillhttps://supabase.com/docs/guides/auth/quickstarts/react-native |
Minimal reproducible example
https://gist.github.com/federico-hv/8a5459b23867635b66f97e0605e73b57
What platform(s) does this occur on?
iOS
Where did you reproduce the issue?
in a development build
Summary
Using the URL web api to validate a search param I was getting a wrong value and realized that the method
url.searchParams.has
returns true even when an incorrect value is given. I saw that expo apparently uses this implementation of URL https://github.com/charpeni/whatwg-url here https://github.com/expo/expo/blob/sdk-52/packages/expo/src/winter/url.ts so I triedwhatwg-url-without-unicode
and it seems the bug is on their side. I reported the bug here charpeni/whatwg-url#7 and create a gist here to explain it https://gist.github.com/federico-hv/8a5459b23867635b66f97e0605e73b57Environment
Expo Doctor Diagnostics
The text was updated successfully, but these errors were encountered: