vue-cli: Cannot read property 'android' of undefined
Version
3.7.0
Environment info
mac
Steps to reproduce
['@vue/app', {
polyfills: [
// all polyfills list -> https://github.com/zloirock/core-js
'es6.object.assign',
'es6.array.find',
'es6.array.iterator',
'es6.function.name',
'es7.object.values',
'web.dom.iterable'
]
It seem caused by’web.dom.iterable’
What is expected?
build is running
What is actually happening?
Cannot read property ‘android’ of undefined
['@vue/app', {
polyfills: [
// all polyfills list -> https://github.com/zloirock/core-js
'es6.object.assign',
'es6.array.find',
'es6.array.iterator',
'es6.function.name',
'es7.object.values',
'web.dom.iterable'
]
It seem caused by’web.dom.iterable’
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 17 (4 by maintainers)
Updating my
babel.config.js
fixed this issue for me:Hi, encountered the same issue with any polyfill starting with
es.*
orweb.*
looks like@vue\babel-preset-app\index.js
(v3.8) is getting a list of polyfills from(I have @babel/preset-env@7.3.4) then
includes
contains"web.dom.iterable"
which is not in builtInsListbuiltInsList[item]
is undefined which later throws an exception. So it looks like only keys from this file will workI can see that it has changed in the recent version of vue-cli and babel-env.
I have this error (I will update versions on my project)
package.json
"dependencies": { "vue": "2.6.10", "vue-moment": "^4.1.0", "vue-router": "3.0.7", "vuex": "3.1.1", "vuex-persist": "2.0.1" }
and
"devDependencies": { "@babel/core": "^7.4.5", "@vue/cli-plugin-babel": "^4.1.1", "@vue/cli-plugin-eslint": "^4.1.1", "@vue/cli-plugin-unit-jest": "^4.1.1", "@vue/cli-service": "^4.1.1", "@vue/eslint-config-airbnb": "^4.0.0", "@vue/test-utils": "^1.0.0-beta.29", "audit-ci": "^1.4.1", "auditjs": "^3.1.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "^10.0.1", "babel-jest": "^25.1.0", "eslint": "^5.15.3", "eslint-plugin-vue": "^5.2.2", "node-sass": "^4.11.0", "sass-loader": "^7.1.0", "vue-svg-loader": "^0.12.0", "vue-template-compiler": "^2.6.10", "webpack": "^4.33.0", "webpack-dev-server": "^3.3.1" }
babel.config.js
it happened after I use: yarn upgrade-interactive
Got this working by reinstalling @vue/cli
npm install -g @vue/cli
.babel.config.js
@jhildings Did you add
core-js@3
? Vue CLI v3 is only compatible withcore-js@2