axios IE promise doesn't work

后端 未结 2 1210
慢半拍i
慢半拍i 2020-12-18 06:16

I am using axios for ajax communication. I have problem with IE. IE return error about Promise. IE doesn\'t know anything about Promise.

I am writing react/redux but

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 06:42

    Android 4.x and axios And Promise

    In Android 4.X I had similar problem. I solve it by using es6-promise in webpack config:

    Promise: 'es6-promise'

    plugins: [
        //tells webpack where to store data about your bundles.
        new BundleTracker({filename: './webpack-stats.json'}),
    
        //makes jQuery available in every module
        new webpack.ProvidePlugin({
            $: 'jquery',
            jQuery: 'jquery',
            'window.jQuery': 'jquery',
            Promise: 'es6-promise'
        }),
    
        // Configure path for served CSS files ("desktop_css" will be served as /dist/desktop_css.css)
        new ExtractTextPlugin('[name].css'),
    ],
    

    For more Information look at:

    https://github.com/axios/axios/issues/188

    Yes Promise wasn't introduced for Android until 4.4.4

    http://caniuse.com/#feat=promises


    'Promise' is undefined

    https://github.com/webpack/webpack/issues/4254

提交回复
热议问题