Coder Social home page Coder Social logo

Comments (10)

raykle avatar raykle commented on May 18, 2024 3

Hi @jspizziri, I'm facing the issue, and I finally resolve the issue by adding the code below at the first line of index.d.ts through patch-package. I tried this by referring to other packages.

+/// <reference types="node" />
 declare module 'react-native-url-polyfill' {

Happy to know the reason if somebody knows.

from react-native-url-polyfill.

charpeni avatar charpeni commented on May 18, 2024 2

I'll close this issue as it was resolved by #444, thank you, @raykle!

It will soon be published on npm.

from react-native-url-polyfill.

jspizziri avatar jspizziri commented on May 18, 2024 1

I reverted my dependency upgrades and I can confirm that the polyfill was working again. So I examined all reapplied all my dependency changes one by one and identified the one that was causing the issue:

react-native-gesture-handler@^1.9.0 -> ^2.4.2

It seems upgrading to the latest version here is somehow breaking the polyfill. Interestingly I do see some references in the platforms folder to the react-native-gesture-handler package.

@charpeni any insights on what could be going wrong here? I'd be happy to submit a PR to fix it if I understood the issue.

from react-native-url-polyfill.

ad-walker avatar ad-walker commented on May 18, 2024 1

Using the JS entry point import (Option 1) in place of the per file import (Option 3) resolved the issue on my end.

from react-native-url-polyfill.

charpeni avatar charpeni commented on May 18, 2024

What's the type for NativeURL do you have?

import { URL as NativeURL, URLSearchParams as NativeURLSearchParams } from 'url';

Mine is from @types/node/url.d.ts.

from react-native-url-polyfill.

AroldoGoulart avatar AroldoGoulart commented on May 18, 2024

Same error with me
Captura de Tela 2021-11-11 às 20 50 09
:

from react-native-url-polyfill.

jspizziri avatar jspizziri commented on May 18, 2024

I've been using this pollyfill for quite some time in my project. I upgraded a few RN packages (not RN itself or anything to do with typings or this behavior) and all the sudden I started getting the same error (and many more related to the polyfill seeming to not exist anymore in my project).

Note, I'm using the direct import method (e.g. import { URL } from 'react-native-url-polyfill';).

from react-native-url-polyfill.

17Amir17 avatar 17Amir17 commented on May 18, 2024

Im having the same issue

from react-native-url-polyfill.

pasquale95 avatar pasquale95 commented on May 18, 2024

Hi, I face the this issue when working with this lib. Additionally, such issue does not allow to retrieve the fields from the URL object. The solution from @raykle seems to fix the issue.
@raykle can you make a PR with your fix so it gets merged?

PS: The solution from @ad-walker works with JS, but not with TS where I still face the issue.

from react-native-url-polyfill.

raykle avatar raykle commented on May 18, 2024

@pasquale95 Yes I have submitted a PR.

from react-native-url-polyfill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.