Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

Unexpected return on isPrototypeOf on IE10 #66

Closed vincegobelins closed 4 years ago

vincegobelins commented 4 years ago

Hi ! Firstly, thanks for your works :)

I have to make Highway run in IE10. I have just only one issue. When my website run on IE10, the console log Unhandled promise rejectionTypeError: Cannot call a class as a function.

I found that the issue is in the Helper.js file at line 139.

if (typeof renderer === 'function' && !Renderer.isPrototypeOf(renderer)) {
        return Promise.resolve(renderer()).then(({ default: cons }) => cons);
      }

!Renderer.isPrototypeOf(renderer) return false on every browser except on IE10. It run into the condition, execute renderer like a function and crash.

If I comment 139 / 141 of Helpers.js, everythings works fine. If you want to test, the same behavior appear on your website.

So my questions are :

Thanks a lot !

Anthodpnt commented 4 years ago

Hi @vincegobelins,

You can support IE10 by using tools like Webpack or Parcel to transpile the code of Highway from ES6 to ES5. You'll also need some polyfills since Highway is using the Fetch API.

Best regards, Anthodpnt