Comments (10)
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.
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.
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.
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.
What's the type for NativeURL
do you have?
react-native-url-polyfill/index.d.ts
Line 2 in 29942dd
Mine is from @types/node/url.d.ts
.
from react-native-url-polyfill.
from react-native-url-polyfill.
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.
Im having the same issue
from react-native-url-polyfill.
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.
@pasquale95 Yes I have submitted a PR.
from react-native-url-polyfill.
Related Issues (20)
- ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. HOT 1
- Make react-native peerDependency optional HOT 3
- Error: Cannot create URL for blob HOT 3
- undefined is not an object HOT 7
- Error using Jest. HOT 2
- HTML entities HOT 2
- Support for React Native Web HOT 7
- Different behavior from browser URL HOT 3
- Security: Doesn't encode urls with punycode HOT 4
- Incompatability with react-native-gesture-handler v2 HOT 3
- Parsing search params HOT 2
- Are there any plans to update the whatwg-url-without-unicode dependency to 9.0 or higher?
- ES6 import statements breaks Jest with TS HOT 2
- Error in import package.json HOT 1
- Why are new versions not published? HOT 2
- Crash on react-native app using expo HOT 3
- Test Suite breaking! HOT 1
- URL should normalize host according to spec HOT 1
- Doesn't work with Android App Bundle HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-url-polyfill.