Parse import doesn't work with react-native 0.32.0, well working on 0.31.0


var Parse = require(parse/react-native)
The same behavior on 0.31 and 0.32
Ran into this issue as well. I was able to patch it by changing the following line in node_modules/parse/lib/react-native/StorageController.react-native.js
var _reactNative = require('react-native');
to
var _reactNative = require('../../../react-native');
Basically just pointed it to the react-native in my node_modules folder instead of letting require() figure it out. Very dirty fix, but it's working for me now with RN 0.32.0 and RN 0.33.0-rc.0. Not really sure what is happening. I plan on digging into it later tonight when I have more time. If I find something I'll submit a PR if a fix doesn't land before.
I'm thinking about dozens of npm package working like Parse impacted by that littles changes on React-Native
Seeing the same issue here. Did anyone manage to track down the source of it? Looks pretty disturbing
reproduced here: https://github.com/bakery/parse-react-native-32
Any updates on this? I have been trying to hunt down the source of this issue but without much luck - I did however notice that RN's packager does not seem to have a module id for "react-native" when called through their patched require function, instead it passes the string literal "react-native" (and not a module id integer)
@jarredwitt @didierfranc any ideas on how to get Parse team at least remotely interested in looking into this? I tried tweeting at them with no result - https://twitter.com/callmephilip/status/778666813278347300
I'll do my best to understand what's happening here, and try to come up with a fix
is anyone resolved this issues?
Can confirm it's still with RN 0.34
Recently, RN changed their Babel transforms to manually rewrite require('react-native') to the relative path of the library. I believe this is the cause of the issue, and I've been trying to find the amount of Babel processing needed on the Parse side to make things work smoothly with the processor on the RN side. Should have something working by the end of the day, if all goes well.
Should be fixed. I'm able to start up a new RN project from scratch with v0.34
What a change! Thank you very much. I can confirm its working with RN v0.34
thank you @andrewimm
Hey guys, I'm curious how you got this to work?
Indeed, I no longer get errors for the library, however queries don't seem to work. I receive "Can't authenticate to your Mongo database" when attempting to find() query results. How do you guys do it?
Doesn't work in RN 0.43 for me either
Still broken for 0.43
It seems that in 0.43, react-native/Libraries/react-native/react-native.js was renamed to react-native/Libraries/react-native/react-native-implementation.js
So in node_modules/parse/lib/react-native/StorageController.react-native.js change the import line to:
import { AsyncStorage } from 'react-native/Libraries/react-native/react-native-implementation.js'
Most helpful comment
Ran into this issue as well. I was able to patch it by changing the following line in node_modules/parse/lib/react-native/StorageController.react-native.js
to
Basically just pointed it to the react-native in my node_modules folder instead of letting require() figure it out. Very dirty fix, but it's working for me now with RN 0.32.0 and RN 0.33.0-rc.0. Not really sure what is happening. I plan on digging into it later tonight when I have more time. If I find something I'll submit a PR if a fix doesn't land before.