Zaraz (s.js) file doesn't support old browsers (ES6 JS)

Hi,

I’m getting a lot of errors around the /cdn-cgi/zaraz/s.js file.

I’m including Zaraz manually on my website I’m wondering if that’s what’s causing it. I would doubt it, since I’m not calling the s.js file directly, the i.js file calls it.

Which brings me to my main issue: s.js uses ES6 syntax and triggers errors all over the place.

According to CANIUSE, almost 4% of people don’t have browsers that can support Arrow Functions.

Please help if possible, I can’t just give up on analyzing 4% of my traffic.

Any help is greatly appreciated.

  • Paul
1 Like

Zaraz uses arrow functions and we are not considering changing that.

The less than 4% of user you are talking about are using IE (from 2013), Opera Mini (2015), or another browser from 2016 and earlier. Supporting browsers that old will hurt the experience of users with a modern browser (> 96% of the users), so we decided to not do that.

1 Like

Thank you for the clarification. I agree in principle, no need to support IE and Opera Mini.

But the error I’m getting " Unexpected token “=” " is happening with a wider range of browsers, please see screenshots below

Info: I have errors are reported as events to google analytics, (in the Event Label, I have the name of the file responsible and it’s indeed s.js, even though it’s not visible below)

I can’t share a second image b/c I’m a new user, but here are some more browsers that trigger the same error:

Safari 13.1.2, 12.1.2, 13.0.5 and Safari (in-app) version unknown

Chrome 71.0.3542.0
Chrome 70.0.3538.110

Thanks again for the info you shared.

We cannot debug this without seeing the full error.

I have the same issue for Safari 13.1.2 Mac OS X Version: 10.13.6

* `/cdn-cgi/zaraz/s.js` at line `1:0`

In App

  1. 1

(function(w,d){zaraz.debug=(fC="")=>{document.cookie=`zarazDebug=${fC}; path=/`;location.reload()};window.zaraz._al=function(fv,fw,fx){w.zar {snip}

Tell us where your source code is

  2. 2

//

  3. 3

zarazData.c=d.cookie;

  4. 4

//

  5. 5

ej.data={...ej.data,...ef};ej.zarazData=zarazData;fetch("https://example.com/cdn-cgi/zaraz/t",{credentials:"include",keepalive:!0,method:" {snip}

  6. 6

//

I have the same issue for Safari 13.1.2 Mac OS X Version: 10.13.6

* `/cdn-cgi/zaraz/s.js` at line `1:0`

In App
  1. 1
(function(w,d){zaraz.debug=(fC="")=>{document.cookie=`zarazDebug=${fC}; path=/`;location.reload()};window.zaraz._al=function(fv,fw,fx){w.zar {snip}

Tell us where your source code is
  2. 2
//
  3. 3
zarazData.c=d.cookie;
  4. 4
//