-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Cannot run examples on master: warning is not a function
#2234
Comments
Related to this #2058 bug? But @brentvatne's solution did not work for me. |
I've tracked it down to: https://github.com/facebook/react-native/blob/master/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js#L19 Also, seems related to this #2062 PR by @brentvatne. |
Talked to brentvatne and he said: dubert [1:03 PM]: I did a search for brentvatne [1:08 PM]: react-tools dubert [1:12 PM]: Ah, found it. It’s weird that it’s not getting it. brentvatne [1:12 PM]: it is but it throws an exception because process.env.NODE_ENV isn’t defined |
Having the same issue - cannot run many react apps. xcode 6.4, osx 10.10.3 (14D136). |
Having the same issue. No idea how to debug. |
+1 Rolling back to 0.8.0 fixed this issue for me as well. |
Seeing the same issue as well. |
Wondering if this is related to: #2279? @brentvatne |
@DUBERT - yeah I'm thinking that might help, can you try cherry-picking it to confirm? |
Still seeing this issue any update @DUBERT |
@brentvatne I'm still seeing this issue on 0.9.0, 0.10.0-rc, with and without the NODE_ENV polyfill |
I got it working for me now! I thought that I was running iojs2.5 via nvm, but it look like I was still on node. When I flipped to iojs and ran npm install and recompiled it was good to go. |
@cgray9 I'm using nvm, so that might be it. Can you explain a little more clearly what was the problem and what you did to fix it? |
@DUBERT - I was receiving the exact same error message that you posted originally when I upgraded from 0.8.0 to 0.9.0 or 0.10.0-rc. I'm using the fish shell and had used bass to run nvm and install iojs2.5.0. However, I had not sourced nvm in my fish profile so when I compiled and the terminal launched it was pulling node instead of iojs. There was a message in the terminal stating that I was running node and needed to switch to iojs. For simplicity sake I switched to bash shell for now and sourced nvm in my bash profile. Looks something like this:
Let me know if I can provide any further details! |
Aha! My nvm was not defaulting to iojs. So I had to run |
I have positively been running io.js all the time while trying to get React Native working but have been struggling with this issue anyway for some days—and thought I might share my findings. I saw the issue after integrating the Om (ClojureScript interface to React https://github.com/omcljs/om) and Ambly (ClojureScript REPL into JavaScriptCore https://github.com/omcljs/ambly) libraries. It turned out that Om has a dependency on React and comes with its own set of packaged React modules in a file called react.inc.js. If that file is placed in the folder structure in or below the React Native project you have the conundrum because the packager will pick up that very file and inject stuff from there into the package being generated. Then the index.ios.bundle or main.jsbundle might look like this around the definition of the warning module: Notice, how the warning module clocks in at almost 15K lines of code. It seems a bit much for such relatively simple functionality. Also, the export from the warning module is no longer a function but an object which fits the error message displayed above. Remove the react.inc.js file buried in the folder structure and a more reasonably sized warning module is put together by the packager: I haven't looked into to exactly why the packager does what it does in this scenario and am not planning on it either. I'll just refrain from placing already packaged React stuff in the folder structure the packager is operating on. |
@tblomseth I encountered something (perhaps the same) when upgrading the Ambly quick start from RN 0.6 to 0.8 and restructured the tree to avoid letting the RN packager see the ClojureScript compiler output directory. |
I have the same issue (looks like the packager is picking up some other massive file instead of the "warning" module) but I don't seem to have a react.inc.js in my tree. Is there an easy way to get the packager to tell me how it resolved each module lookup so I can track down the problem? |
I went the hacky route and stuck a Found that the file it's resolving "warning" to is I'm going to delete that file now (and add a postinstall npm command to do it next time), it would be nice to be able to configure the packager to ignore files though (and also to have it be a bit more sensible about where it gets its modules from!) |
I solved this by simply installing |
I'm just leaving a note here to say that I encountered this issue as well, and it was a real road-block. I updated to The solution @almost mentioned - deleting the file |
Same issue for me. Just delete the file |
omg @PascalGiessler you save my night ! Thank you ! |
Thanks @PascalGiessler and @almost 👍 |
I did what @almost suggested and am still having the same exact issue. Even tried Edit: Fixed by upgrading to Node v4.0.0. |
Having this same issue. Fixed with @almost 's solution. |
😈👿👿👿 |
Thanks @almost ! It worked. |
Amazing, thank you @PascalGiessler. Was stuck on this for a while |
thanks @PascalGiessler and @almost. Works now :) |
I encountered the same issue, what i discovered was in recent versions of react native(in Debug Mode) you have to keep "JS Dev Mode" on, without it you will face this issue |
react-native: master
OS X: 10.11 Beta (15A244d)
Xcode: 7.0 beta (7A121I)
(Yes, I know I'm running a lot of beta software, but it works on rn@0.8.0)
Build succeeds, but then I get this error:
This is my console in Xcode:
The text was updated successfully, but these errors were encountered: