Skip to content

Commit cc38420

Browse files
authored
fix: better error message for non-existent polyfill names (#5543)
Fixes #3578
1 parent 1a8c7fd commit cc38420

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/@vue/babel-preset-app/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ function getPolyfills (targets, includes) {
8181
}
8282

8383
const compatData = require('core-js-compat').data
84-
return includes.filter(item => isRequired(item, targets, { compatData }))
84+
return includes.filter(item => {
85+
if (!compatData[item]) {
86+
throw new Error(`Cannot find polyfill ${item}, please refer to 'core-js-compat' for a complete list of available modules`)
87+
}
88+
89+
return isRequired(item, targets, { compatData })
90+
})
8591
}
8692

8793
module.exports = (context, options = {}) => {

0 commit comments

Comments
 (0)