Error: [vuex] vuex requires a Promise polyfill in this browser. 与 babel-polyfill 的问题
2018-02-07 09:37
881 查看
Error: [vuex] vuex requires a Promise polyfill in this browser. 与 babel-polyfill 的问题
采用最笨重的解决方案就是npm install babel-polyfill 然后在webpack中如此设置:
但在开发环境下,我们在IE11打开的时候依然有问题(但在现代浏览器中浏览居然没问题)。打开源码,可以看到是app.js先加载,然后才加载babel-polyfill. 其实在生产环境下(webpack编译之后)。可以正常运行。这是因为在webpack.prod.conf.js中的HtmlWebpackPlugin加入了 hunksSortMode: 'dependency' 属性。所以我们只要依样画葫芦。在webpack.dev.conf.js中找到[b]HtmlWebpackPlugin加入了 hunksSortMode: 'dependency' 属性即可[/b]
采用最笨重的解决方案就是npm install babel-polyfill 然后在webpack中如此设置:
entry: { 'babel-polyfill': 'babel-polyfill', app: './src/main.js' },
但在开发环境下,我们在IE11打开的时候依然有问题(但在现代浏览器中浏览居然没问题)。打开源码,可以看到是app.js先加载,然后才加载babel-polyfill. 其实在生产环境下(webpack编译之后)。可以正常运行。这是因为在webpack.prod.conf.js中的HtmlWebpackPlugin加入了 hunksSortMode: 'dependency' 属性。所以我们只要依样画葫芦。在webpack.dev.conf.js中找到[b]HtmlWebpackPlugin加入了 hunksSortMode: 'dependency' 属性即可[/b]
相关文章推荐
- IE报vuex requires a Promise polyfill in this browser问题解决
- IE报vuex requires a Promise polyfill in this browser问题解决
- IE浏览器报Promise未定义的错误、解决vuex requires a Promise polyfill in this browser问题
- vue.js之路(5)——解决vuex requires a Promise polyfill in this browser问题
- 【vuex】【vue】【兼容】IE报vuex requires a Promise polyfill in this browser问题解决
- Vue-cli 在IE下[vuex] vuex requires a Promise polyfill in this browser.问题
- VUE 报 Error: [vuex] vuex requires a Promise polyfill in this browser.
- vuex requires a Promise polyfill in this browser
- Vuex requires a Promise polyfill in this browser
- vuex requires a Promise polyfill in this browser
- vue做的项目在ie11下一片空白:vue requires a Promise pllyfill in this browser
- 解决“requires a Promise polyfill in this browser”错误
- 问题解决: error: ‘SCM_CREDENTIALS’ undeclared (first use in this function)
- Error:This Gradle plugin requires Studio 3.0 minimum 问题 笔记
- 编译minicom出现问题:error: ‘BC’ undeclared (first use in this function)
- vue问题: 解决ERROR in xxx.js from UglifyJs
- Angular build Error:In this configuration Angular requires Zone.js
- 解决问题 “error: `cout' was not declared in this scope”
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
- app.js:1274 [Vue warn]: Error in render: "TypeError: Cannot read property 'object_id' of undefined"问题小记