-1

I'm currently working on a SPA React app, but when I try to fetch as google I get a blank page with the error Uncaught SyntaxError: Unexpected token =>. I did install babel-polyfill and also imported it as first import. I've been reading and trying multiple things but I can't seem to fix it, anyone experience with this?

The site is https://sharetune.nl

The error image is shown below:

error

Edit: I tried to fetch as google while my app.js wasn't minified. the error is in this piece of code

const prefix = (items) => {
  const result = {}
  for (const i in items) {
    result[items[i]] = swalPrefix + items[i]
  }
  return result
}

You can view the app.js file at http://sharetune.nl/js/app.js

Merijn
  • 41
  • 1
  • 8

1 Answers1

0

As you say above, the google fetch bot uses Chrome 41 - which does not support arrow functions.

https://caniuse.com/#feat=arrow-functions

jsdeveloper
  • 3,945
  • 1
  • 15
  • 14
  • I'm running version 73.0.3683.75 of Chrome so I don't think this is the problem, when fetching as google I don't think my own browser is being used to render the page. – Merijn Mar 17 '19 at 17:46