-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic imports of routes (code splitting) requires vue.config.js tweak for IE11 support #1642
Comments
Same issue here. Already tried with babel-polyfill. |
I hit the same error recently while using a dynamic import to load a polyfill. The polyfill IE11 needs is If you'd rather avoid module.exports = {
presets: [['@vue/app', {
polyfills: [
'es6.array.iterator',
'es6.promise'
]
}]]
} |
Hm, weird. This was supposedly fixed in babel-preset-env back in February: |
@LinusBorg That PR fixed detection of Promise usage in app code or dependencies listed in You can confirm this by following the same steps as @drewtownchi's instructions but instead of steps 6 and 7, adding this to main.js: function fakePromise() {
return Promise.all()
} Relying on I took a look at the webpack docs and tried the Promise polyfills listed there and both work on their own, so it's specific to the modular core-js polyfills used by babel-preset-env (core-js Incidentally, when I tried to specify module.exports = {
presets: [['@vue/app', {
polyfills: ['es6.string.iterator', 'web.dom.iterable', 'es6.promise'],
targets: { chrome: '62' }
}]]
} |
Thanks for digging into this. The error about If not, I would like to skip this error in the context of this issue, and make sure that we add |
Yep, The string iterator one wasn't a typo, but I initially tried to fix the error by applying the same polyfills from that Babel PR in my babel.config.js ( What confused me is that if you force Babel to apply the same polyfills by having I presume |
Version
3.0.0-beta.16 - 3.0.0.-rc.3
Reproduction link
https://github.com/drewtownchi/VueRouterTranspile
Steps to reproduce
transpileDependencies: [
"vue-router"
]
}
What is expected?
The page should display with out an error in the console and load the page
What is actually happening?
The page is not loading due to the dynamic import.
Documentation should be provided that dynamic imports or vue router code splitting needs to transpile the vue-router dependency or that an additional polyfill is necessary. I'm not sure what the appropriate workaround is (if it is possible to get this to work without the transpile in vue.config.js)
The text was updated successfully, but these errors were encountered: