I\'m building a site with ES6 and Babel.
In a script file, I need to make an ajax call to a service on server. For that I\'m doing like this:
fetch(\
Just went through this last night. In the end, after trying all sorts of things, the solution was fairly simple:
fetch('url').then(
response => response.json()
).then(
supervisoryItem => doSomething(supervisoryItem)
)
became
window.fetch('url').then(
response => response.json()
).then(
supervisoryItem => doSomething(supervisoryItem)
)
TL;DR fetch(stuff) should be window.fetch(stuff) EDIT This worked for me on Chrome