Hi,
I'm playing with Relay Modern on React Native. It doesn't pass props down when running normally (though requests are made), it does only when I switch to debugging in browser (though request are still made from the device).
Not sure it's the same problem from what you've said, but probably related to this: https://github.com/zloirock/core-js/issues/297
At some point the runtime checks if pendingQueries.size is truthy, but the Set polyfill use by relay returns undefined on android (yeah, wtf). I've submitted a PR fixing it, but it hasn't been accepted yet.
Meanwhile, adding the code below fixed it for me:
(function(PolyfillSet) {
if (!PolyfillSet) {
return;
}
var testSet = new PolyfillSet();
if (testSet.size === undefined) {
if (testSet._c.size === 0) {
Object.defineProperty(PolyfillSet.prototype, 'size', {
get: function() {
return this._c.size;
},
});
}
}
})(require('babel-runtime/core-js/set').default);
thanks, works like a charm.
I have the same problem here, everything works fine in iOS and Android when attached to ChromDevtool, but not in unattached or release mode on my phone. Could you please let me know where to apply the above fixes?
I looked at core-js source and latest version installed on my box is way older than what we currently have on the github repo. Looks like nothing has been released since a year ago. :( It is not an easy job to apply your changes. Only way is to replace the local installed core-js in node_modules.
Just add the snippet i posted to your index.js,before everything else.
Should work.
It seems that the core -js mantainer has been applying some fixes lately,
so I'm hoping for a new release
Em seg, 8 de mai de 2017 08:55, Morteza Alizadeh notifications@github.com
escreveu:
I have the same problem here, everything works fine in iOS and Android
when attached to ChromDevtool, but not in unattached or release mode on my
phone. Could you please let me know where to apply the above fixes?I looked at core-js source and latest version installed on my box is way
older than what we currently have on the github repo. Looks like nothing
has been released since a year ago. :( It is not an easy job to apply your
changes. Only way is to replace the local installed core-js in node_modules.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/relay/issues/1704#issuecomment-299847183,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKP0Ur_6zW0FdUFlJ1c-2JVZZ8FdJ0rTks5r3wKxgaJpZM4NKx06
.
Thanks heaps man, worked
@gusbicalho, thanks. Your black magic fixed my Android QueryRenderer for React-Native. I wasn't getting the props through the results.
Could you please explain why/how this fixes the issue... It's frustrating that it doesn't make any sense whatsoever.
Thank you again.
@petersuwara see https://github.com/zloirock/core-js/issues/297 for an explanation of the bug. Apparently the polyfill used by relay is not compatible with the base implementation of Set on react-native android. I don't know why the implementation for ios is different.
What my snippet does is require the Set polyfill that relay uses, then monkey-patch it to add the size property, which was missing. The polyfill wraps the original Set and stores is as _c, so i can get the set size from there.
I don't know how long it will take to have a working version of this. core-js development doesn't seem very active :/ the mantainer apparently merged a fix, but hasn't released a new version to npm yet.
Closing since the problematic Set polyfill will no longer be included in the next release.
I have this problem on a new React Native project. I am using the latest versions of react-relay.
Adding the script by @gusbicalho does not seem to work.
Any ideas?
EDIT:
For anyone still getting this error.
I rolled back react-realy version to an older one and now it works.
Most helpful comment
Not sure it's the same problem from what you've said, but probably related to this: https://github.com/zloirock/core-js/issues/297
At some point the runtime checks if
pendingQueries.sizeis truthy, but the Set polyfill use by relay returnsundefinedon android (yeah, wtf). I've submitted a PR fixing it, but it hasn't been accepted yet.Meanwhile, adding the code below fixed it for me: