trevorr / tsfv

Typescript Fluent Validation Library
ISC License
5 stars 0 forks source link

IE11 Compatibility #4

Closed rafaelytakei closed 4 years ago

rafaelytakei commented 4 years ago

Hi, is there some way to make this lib IE11 compatible? I'm currently using it on a new project which requires IE11 support, but I couldn't make it work with babel

trevorr commented 4 years ago

I just pushed version 1.0.2, which includes a SystemJS ES5 build for browsers as old as IE 10. You may need to tell your bundler to use the browser entrypoint instead of main. More info here: https://2ality.com/2017/04/setting-up-multi-platform-packages.html

I don't have an easy way to test IE 11 myself, so please let me know how it goes.

rafaelytakei commented 4 years ago

Hey, thanks for the fast answer! I still couldn't get it to work, I'm currently using webpack, so it ends up defaulting to browser instead of main already.

Before your push, I was getting an error because there was a class on the code, which wasn't supported by IE11, but now that seems to be fine. However, now I'm getting the following error:

SCRIPT5007: Object expected which redirects to this part of the code (the void 0 in the 5th line).

I'm not very used to reporting things like this, so I'm not even sure if the image helps, but if you need anything else just let me know! Thanks again!

trevorr commented 4 years ago

I think that's the SystemJS module registration. You probably need to include the SystemJS minimal loader in your build.

Background: To output a single file for browser use, I needed to use AMD or SystemJS. I chose the latter because it can be used universally.

Regarding Webpack, this may be helpful: https://github.com/systemjs/systemjs#compatibility-with-webpack