-
Notifications
You must be signed in to change notification settings - Fork 396
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
Does not work in NodeJS (ReactJS Native) #484
Comments
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?
For example, what is Also, can you provide a complete stack trace of the error? Thanks! |
@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 |
yes, only require cause an error |
facebook react native takes use of nodejs,but there must be some difference |
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. |
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 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? |
thank you ,please open one |
My colleague managed to fix the problem, it seems the file path is incorrect in React Native.. For example |
Hey @wangjia184, thanks for the update. Do you mean that there is a bug in React Native? |
I solved this issue by creating a {
"dependencies": {
"when": {
"version": "3.7.7",
"from": "when@3.7.7",
"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 This works only with React Native v0.35+ (facebook/react-native@5710b23) |
I can not use this, the error always occurs because of the third-party say: "peer component invalid: react@16.0.0-alpha.6", when i using npm-shrinkwrap. Do you know other ways to fix this problem with whenjs |
@beerTeam , try to use the minimal version of javascript file in nodejs. The minimal version should include when.js by itself. |
When loading this component in nodejs via
require
, Facebook React Native environment.It ends with error "undefined is not a function (evaluating 'when.lift(all)')"
Any idea how can I fix this issue?
The text was updated successfully, but these errors were encountered: