React-static: Polyfill needed when using automatic routing in IE11

Created on 26 Nov 2017  Â·  3Comments  Â·  Source: react-static/react-static

Hi, i was recently looking for static website generators. I have really like working with React and love react-static's approch to solve this kind of problems.

However, when i switched from blank template to basic i discovered that IE 11 needed a polyfill to work with react-static sites with automatic routing.

What would be the best practice solution for this issue :-) ?

Most helpful comment

Hi @thupi! I'm not quite sure what API you are missing in IE 11. Do you see an error in the console?

I would guess it's the Promise API. You can use e.g. promise-polyfill.

import Promise from 'promise-polyfill'; 

if (typeof window !== "undefined" && !window.Promise) {
  window.Promise = Promise;
}

All 3 comments

Hi @thupi! I'm not quite sure what API you are missing in IE 11. Do you see an error in the console?

I would guess it's the Promise API. You can use e.g. promise-polyfill.

import Promise from 'promise-polyfill'; 

if (typeof window !== "undefined" && !window.Promise) {
  window.Promise = Promise;
}

Yes this is a great approach.
On Sat, Nov 25, 2017 at 4:19 PM Emil Tholin notifications@github.com
wrote:

Hi @thupi https://github.com/thupi! I'm not quite sure what API you are
missing in IE 11. Do you see an error in the console?

I would guess it's the Promise API. You can use e.g. promise-polyfill
https://www.npmjs.com/package/promise-polyfill.

import Promise from 'promise-polyfill';
if (!window.Promise) {
window.Promise = Promise;
}

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/nozzle/react-static/issues/199#issuecomment-346972658,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCeKO5j452-hqdfVF4LxWjLotMtZbks5s6KCQgaJpZM4Qqlo7
.

Thanks for the quick response :-) ! I'll do that :-) !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

calvinrbnspiess picture calvinrbnspiess  Â·  4Comments

lottamus picture lottamus  Â·  3Comments

getDanArias picture getDanArias  Â·  4Comments

achenwei-chwy picture achenwei-chwy  Â·  3Comments

RAMTO picture RAMTO  Â·  4Comments