Comments (12)
Possibly related cujojs/rest#137
In this case, it looks like the browser bundle is trying to be loaded, but can't be resolved correctly. I'm not sure why the browser bundle is trying to be loaded, or why it can't be found.
from when.
I solved this issue by creating a npm-shrinkwrap.json
file and overwriting browser
field which was causing issues:
{
"dependencies": {
"when": {
"version": "3.7.7",
"from": "[email protected]",
"browser": false
}
}
}
Overwrites this: https://github.com/cujojs/when/blob/master/package.json#L75-L78
@briancavalier it's really easy and quick to set up React Native test app if you wanna do some further testing around this problem; it should be pretty easy to solve.
If I would hit this issue by using when
directly, I'd just switch to using something else instead. Now I hit the problem trough sub-dependencies (of Mopidy) so I had to fix it with this hack.
This works only with React Native v0.35+ (facebook/react-native@5710b23)
from when.
@beerTeam , try to use the minimal version of javascript file in nodejs. The minimal version should include when.js by itself.
from when.
Hi @wangjia184. I don't use FB React Native, but when certainly works in Node.js versions 0.8 thru 5.x. Can you provide a bit more context about the example code you showed?
when.lift(all)
For example, what is all
? The purpose of when.lift
is to take a non-promise-returning function, and give you back a promise-returning version of that function. So, the input to when.lift
(in this case, all
), must be a function.
Also, can you provide a complete stack trace of the error?
Thanks!
from when.
@wangjia184 Sorry, I realize I misunderstood the issue. So, just want to make sure I understand: the error you are seeing is coming from within when.js itself, and not from code you've written, simply by calling require('when')
?
from when.
yes, only require cause an error
from when.
facebook react native takes use of nodejs,but there must be some difference
from when.
Yeah, it does look like it could be related, @scothis.
Since when.js is known to work on a wide variety of platforms, it probably also makes sense to open an issue with react native, as it looks like they have been working out kinks in their module loading. Apparently, they do override or modify node's require
, and it doesn't quite line up with node's conventions in some cases.
Plus, they may be able to help us more quickly than we could figure this out on our own!
@wangjia184 Do you want to do that, or want me to do it?
from when.
thank you ,please open one
from when.
My colleague managed to fix the problem, it seems the file path is incorrect in React Native..
For example require('../lib...)
should be require('../../lib....')
Hope he can send a pull request
from when.
Hey @wangjia184, thanks for the update. Do you mean that there is a bug in React Native?
from when.
I can not use this, the error always occurs because of the third-party say: "peer component invalid: [email protected]", when i using npm-shrinkwrap. Do you know other ways to fix this problem with whenjs
RN 0.44
from when.
Related Issues (20)
- Cannot resolve module 'vertx' HOT 9
- JSPM build (SystemJS builder) failing on [email protected] HOT 3
- Visual Studio debugger breakes from adding When to WebPack bundle. HOT 13
- 3.7.7 breakes the build on Windows HOT 2
- no such file or directory .... es6-shim/makePromise HOT 2
- Global rejection events completely broken in a bundled environment (eg. Webpack)
- When not working in Jasmine tests
- when.reduce UnhandledPromiseRejectionWarning HOT 4
- Misleading unhandled rejection warning when using when.settle HOT 10
- npm install ! has errors HOT 1
- Usage hello world example fails with TypeError HOT 3
- Binding context to promise chain HOT 2
- Add react-native support HOT 2
- File 404 when try to use in browser environment
- Promise.js first function never runs HOT 2
- RTE TypeError after production build HOT 4
- Does function call also accept promises? HOT 4
- Current project status HOT 1
- npm install failing with 404 error code
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 when.