odoe / jsapi-webpack

Sample using the webpack plugin with babel
20 stars 10 forks source link

IE 11 #8

Open abdel-abdelrazek opened 5 years ago

abdel-abdelrazek commented 5 years ago

Hello @odoe This demo worked fine using chrome, but Using IE11 it doesn't do so. And i got this attached error.

ie11 error

Thanks in advance.

tomwayson commented 5 years ago

IE11 doesn't support promises https://caniuse.com/#feat=promises, so BYO polyfill.

abdel-abdelrazek commented 5 years ago

Thanks @tomwayson for your response.

I know that it doesn't support it, but the problem that i really don't understand, is IE11 works fine in development mode, and is able to Render Featurelayers, but as soon as i build it, it doesn't do so.

That happens when i try all demos related to React, like this one and even using @esri/react-arcgis package.

It is not browser version issue, as i mentioned it works fine in development mode and when i create non react apps, just using JS and HTML. The problem only happens when i build the react project.

I will be grateful if u assist me with that.

Thanks in advance.

odoe commented 5 years ago

That's because when webpack does a productuib build, it uses native promises, which I don't think is the case in development mode. You can add a promise shim in your webpack config.

    entry: {
      index: [
        "@dojo/framework/shim/Promise",
        "./src/css/main.scss",
        "./src/index.tsx"
      ]
    },