0

I have a react-relay graphql app that works perfectly on new browsers, but on safari 5.1.10 (2013) it doesn't work. The site is just white. Same happens with older versions of chrome.

The console gives: TypeError: 'undefined' is not a function (evaluating 'e.startsWith("client:")')

I looked through react-relay/dist/relay.min.js and saw isClientID:function(e){return e.startsWith("client:")}.. it seems thats the failing function.

Has anyone encountered this before? Any ideas on a fix or what could be causing it?

new error

  • add the polyfill? https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith – azium Jan 05 '17 at 20:35
  • Thanks! It worked, but now we have an issue with supporting the bind function. I tried these babel plugins but they didnt seem to work: `"syntax-function-bind", "transform-function-bind"` @azium any ideas? –  Jan 06 '17 at 01:38
  • The bind *function* ?? Or do you mean bind syntax `console::log`? – azium Jan 06 '17 at 01:49
  • I just re-read your question.. why on earth are you supporting safari 5 ?! – azium Jan 06 '17 at 01:53
  • haha its unfortunately also happening to i.e 9, 10, & 11. Safari 5 was the whistle blower that led us to discover this. i'm adding the newest error's screenshot to the post @azium –  Jan 06 '17 at 01:56
  • did you try the polyfill again? https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind – azium Jan 06 '17 at 02:00
  • another thing you might want to look at is an es6 -> es3 compiler – azium Jan 06 '17 at 02:01
  • I added the polyfill to the top of the page before any scripts run (below css), but it didn't help. had the same error @azium –  Jan 06 '17 at 11:26

0 Answers0