olefredrik / FoundationPress

FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb
https://foundationpress.olefredrik.com
MIT License
2.7k stars 869 forks source link

Promise in IE not defined #1300

Closed maciekgrzybek closed 6 years ago

maciekgrzybek commented 6 years ago

How can this bug be reproduced?

  1. Install Axios import axios from 'axios';
  2. Fetch some data axios .get(urlRequest) .then((response) => { let temp = parseInt(response.data.main.temp); let weather = response.data.weather[0].id; showWeather(temp, weather, el); }) .catch((error) => { console.log(error); });

What did you expect to happen? Should return correct data from API

What happened instead? Promise is not defined in IE11

Please List the Following:

colin-marshall commented 6 years ago

You need to add the polyfill according to the Axios repo.

axios depends on a native ES6 Promise implementation to be supported. If your environment doesn't support ES6 Promises, you can polyfill.

Source: https://github.com/axios/axios#promises