3.0.0-rc.11
node: v8.11.2/ npm:6.3.0 / OS: macOS 10.13.6
Building success
ERROR Failed to compile with 1 errors 09:31:42
error in ./src/main.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
[BABEL] /Users/xxxxxx/src/main.js: Cannot read property 'android' of undefined (While processing: "/Users/xxxxxx/node_modules/@vue/babel-preset-app/index.js")
at targetEnvironments.filter.environment (/Users/xxxxxx/node_modules/@babel/preset-env/lib/index.js:75:16)
at Array.filter (<anonymous>)
at isPluginRequired (/Users/xxxxxx/node_modules/@babel/preset-env/lib/index.js:74:56)
at includes.filter.item (/Users/xxxxxx/node_modules/@vue/babel-preset-app/index.js:23:12)
at Array.filter (<anonymous>)
at getPolyfills (/Users/xxxxxx/node_modules/@vue/babel-preset-app/index.js:22:19)
at module.exports (/Users/xxxxxx/node_modules/@vue/babel-preset-app/index.js:94:17)
at loadDescriptor (/Users/xxxxxx/node_modules/@babel/core/lib/config/full.js:163:14)
at cachedFunction (/Users/xxxxxx/node_modules/@babel/core/lib/config/caching.js:42:19)
at loadPresetDescriptor (/Users/xxxxxx/node_modules/@babel/core/lib/config/full.js:233:63)
@ multi ./src/main.js
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxxxx/.npm/_logs/2018-08-10T01_31_42_860Z-debug.log
How to fix this?
sry, I tried it and found that I was wrong with the configuration.
// babel.config.js
module.exports = {
presets: [
['@vue/app', {
polyfills: [
'es6.promise',
'es6.object.assign',
'es6.object.keys',
'es6.array.includes'
]
}
]
]
}
When I deleted some configurations, the build was successful.
// babel.config.js
module.exports = {
presets: [
['@vue/app', {
polyfills: [
'es6.promise'
]
}
]
]
}
The question now is how to configure polyfills?
es6.array.includes -> es7.array.includes
Most helpful comment
es6.array.includes->es7.array.includeshttps://unpkg.com/[email protected]/modules/