Outdated dependencies caused `TypeError: programPath.hub.addHelper is not a function`
Version
3.0.5
Node and OS info
Node v8.12.0 / yarn 1.9.4 / Windows 1-
Steps to reproduce
dependencies in @vue/cli-plugin-babal/package.json still using "@babel/core": "7.0.0-beta.47" and "babel-loader": "^8.0.0-0" which are all outdated, and may caused TypeError: programPath.hub.addHelper is not a function, see Babel #8508
after execute yarn serve (vue-cli-service serve), it errored with:
ERROR Failed to compile with 1 errors 15:54:21
error in ./src/main.js
Module build failed (from ./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js):
TypeError: programPath.hub.addHelper is not a function
at wrapInterop (...\node_modules\@babel\plugin-transform-modules-commonjs\node_modules\@babel\helper-module-transforms\lib\index.js:165:45)
at PluginPass.exit (...\node_modules\@babel\plugin-transform-modules-commonjs\lib\index.js:174:70)
at newFn (...\node_modules\@babel\traverse\lib\visitors.js:237:21)
at NodePath._call (...\node_modules\@babel\traverse\lib\path\context.js:65:20)
at NodePath.call (...\node_modules\@babel\traverse\lib\path\context.js:40:17)
at NodePath.visit (...\node_modules\@babel\traverse\lib\path\context.js:109:8)
at TraversalContext.visitQueue (...\node_modules\@babel\traverse\lib\context.js:142:16)
at TraversalContext.visitSingle (...\node_modules\@babel\traverse\lib\context.js:102:19)
at TraversalContext.visit (...\node_modules\@babel\traverse\lib\context.js:182:19)
at Function.traverse.node (...\node_modules\@babel\traverse\lib\index.js:106:17)
at traverse (...\node_modules\@babel\traverse\lib\index.js:76:12)
at transformFile (...\node_modules\@vue\cli-plugin-babel\node_modules\@babel\core\lib\transformation\index.js:116:29)
at runSync (...\node_modules\@vue\cli-plugin-babel\node_modules\@babel\core\lib\transformation\index.js:45:3)
at runAsync (...\node_modules\@vue\cli-plugin-babel\node_modules\@babel\core\lib\transformation\index.js:35:14)
at process.nextTick (...\node_modules\@vue\cli-plugin-babel\node_modules\@babel\core\lib\transform.js:34:34)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
@ multi (webpack)-dev-server/client?http://10.0.75.1:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
What is expected?
What is actually happening?
After all thanks to babel-plugin-transform-vue-jsx #65, change babel-plugin-transform-vue-jsx to ^3.3.0 could fix.
Same error observed.
https://github.com/vuejs/vue-cli/issues/2821#issuecomment-434531428 Same error observed.
See: https://github.com/vuejs/babel-plugin-transform-vue-jsx/issues/65#issuecomment-433630053