Comments (14)
just use npm install querystring
it works for me
from nba.
just use npm install querystring
it works for me
Works for me too :)
from nba.
@MatthewDevelop Just porting a node crypto dependant project into react-native and solved that package's querystring dependency like this!
Love you
from nba.
Try [email protected]
– I've removed querystring
as a dependency. Please let me know if it works or not when you get a chance!
from nba.
hmm.. now I am getting the same error but for different module:
Unable to resolve module `url` from `/Users/zymfilip/Development/src/NBABrowseApp/node_modules/nba/src/get-json.js`: Module does not exist in the module map
it seems to be related to react-native and the issue they are mentioning in error log facebook/react-native#4968
I tried creating simple node app and it works without a problem. Both 4.2.0 and 4.2.1
from nba.
Hm alright yeah so react-native can't pull in Node.js builtin modules (both querystring
and url
are provided by Node.js but included in the browser build by Browserify).
Question for you: do you have the global URL
constructor available in react-native? It's a browser feature https://developer.mozilla.org/en-US/docs/Web/API/URL
from nba.
I added an explicit url
dependency in [email protected]
– can you try that one? Sorry for the back-and-forth
from nba.
No problem, but still no luck ;(
error: bundling failed: Error: Unable to resolve module `http` from `/Users/zymfilip/Development/src/NBABrowseApp/node_modules/node-fetch/index.js`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
Regarding URL
, it looks that there are some issues with URL
in RN facebook/react-native#16434 lately.
It seems that there are some conflicts as I tried adding dependency on http
module in my app and I got following error:
error: bundling failed: Error: While trying to resolve module `http` from file `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/node-fetch/index.js`, the package `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/http/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/http/index.js`. Indeed, none of these files exist:
* `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/http/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/http/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
It seems to me (but I might be wrong as I am quite new to node & react-native) that you are using some dependencies not supported in RN. Is it possible?
from nba.
Yes that's exactly the problem: url
, querystring
, and http
all come from NodeJS – when used outside of Node they need a build step to pull in browser-compatible substitutes for these packages. Can you try the following:
import nba from "nba/dist/nba"
This points directly to the library bundled with all of its dependencies
from nba.
Still no luck
error: bundling failed: Error: Unable to resolve module `./src` from `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/nba/dist/nba.js`: The module `./src` could not be found from `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/nba/dist/nba.js`. Indeed, none of these files exist:
* `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/nba/dist/src(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/zymfilip/Development/src/ReactiveAirQuality/node_modules/nba/dist/src/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
from nba.
Damn. Alright, I'll try compiling it with webpack instead of browserify and see if that helps. I'll get back to you in a couple days
from nba.
same issue here.
from nba.
This totally slipped my mind. Now that the season is about to start... I just published [email protected]
can someone try using import nba from "nba/dist/webpacked"
?
from nba.
great! closing, but if someone else runs into a similar problem please open an issue
from nba.
Related Issues (20)
- Team and Player Images HOT 1
- Calling Stats endpoint HOT 2
- Is it still possible to get shot chart detail? HOT 1
- Error: 404 Not Found HOT 1
- Any way to update Players.json
- How can I work around the CORS restriction so that I can test my site on my browser locally? HOT 3
- It seems that ver.4.8.0 still works for browser apps. HOT 6
- Timeouts HOT 3
- A fix for HTTP being blocked (Mix Content Error) HOT 1
- teamInfoCommon not working HOT 4
- Play by play call seems very delayed HOT 1
- List of Teams & Games HOT 4
- TypeScript type definitions HOT 4
- `nba.stats.scoreboard`: No way to get game start time HOT 5
- Missing `data` endpoints HOT 5
- NBA API - required headers HOT 2
- Newest Version HOT 2
- WNBA? HOT 8
- Not working in server but in local running perfect HOT 2
- players.json missing 2021 rookies HOT 2
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 nba.