SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.47k stars 1.54k forks source link

yarn run dev : TypeError: Cannot read property 'tapAsync' of undefined #1028

Open marcoippolito opened 4 years ago

marcoippolito commented 4 years ago

In executing yarn run dev I get this error:

(base) marco@pc01:~/webMatters/vueMatters/nuovo/GGC$ yarn run dev
yarn run v1.22.4
$ node .electron-vue/dev-runner.js
         ___                      __                                                                
   __   /\_ \       __     ___   /\ \__    _ __    ___     ___              __  __  __  __     __   
 / ,.`\ \//\ \    / ,.`\  /'___\ \ \ ,_\  /\` __\ / __`\ /' _ `\   _______ /\ \/\ \/\ \/\ \  / ,.`\ 
/\  __/   \_\ \_ /\  __/ /\ \__/  \ \ \/  \ \ \/ /\ \_\ \/\ \/\ \ /\______\\ \ \/ |\ \ \_\ \/\  __/ 
\ \____\  /\____\\ \____\\ \____\  \ \ \_  \ \_\ \ \____/\ \_\ \_\\/______/ \ \___/ \ \____/\ \____\
 \/____/  \/____/ \/____/ \/____/   \ \__\  \/_/  \/___/  \/_/\/_/           \/__/   \/___/  \/____/
                                 \/__/                                                          
  getting ready...

┏ Main Process ---------------

  compiling...

┗ ----------------------------

TypeError: Cannot read property 'tapAsync' of undefined
    at /home/marco/webMatters/vueMatters/nuovo/GGC/.electron-vue/dev-runner.js:52:52
    at SyncHook.eval [as call] (eval at create (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/tapable 
/lib/HookCodeFactory.js:19:10), <anonymous>:85:1)
    at SyncHook.lazyCompileHook (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/tapable
/lib/Hook.js:154:20)
    at Compiler.newCompilation (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack
/lib/Compiler.js:631:26)
    at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Compiler.js:667:29
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules
/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/tapable
/lib/Hook.js:154:20)
    at Compiler.compile (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Compiler.js:662:28)
    at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Watching.js:77:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules
/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/tapable
/lib/Hook.js:154:20)
    at Watching._go (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Watching.js:41:32)
    at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Watching.js:33:9
    at Compiler.readRecords (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Compiler.js:529:11)
    at new Watching (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Watching.js:30:17)
    at Compiler.watch (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/webpack/lib/Compiler.js:244:10)
┏ Main Process ---------------

  Hash: e1c0656ef742f3a4f8d4
  Version: webpack 4.43.0
  Time: 91ms
  Built at: 06/24/2020 4:13:00 PM
    Asset      Size  Chunks  Chunk Names
  main.js  8.35 KiB    main  main
  Entrypoint main = main.js
  [0] multi ./src/main/index.dev.js ./src/main/index.js 40 bytes {main} [built]
  [./src/main/index.dev.js] 1.81 KiB {main} [built] [failed] [1 error]
  [./src/main/index.js] 1.81 KiB {main} [built] [failed] [1 error]

  ERROR in ./src/main/index.dev.js
  Module build failed (from ./node_modules/babel-loader/lib/index.js):
  Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/marco/webMatters/vueMatters/nuovo
/GGC/node_modules/babel-preset-stage-0/lib/index.js
      at createDescriptor (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:178:11)
      at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
      at Array.map (<anonymous>)
      at createDescriptors (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:109:29)
      at createPresetDescriptors (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/config-descriptors.js:101:10)
      at presets (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:47:19)
      at mergeChainOpts (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
chain.js:320:26)
      at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-chain.js:283:7
      at Generator.next (<anonymous>)
      at buildRootChain (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
chain.js:120:29)
      at buildRootChain.next (<anonymous>)
      at loadPrivatePartialConfig (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/partial.js:95:62)
      at loadPrivatePartialConfig.next (<anonymous>)
      at Function.<anonymous> (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/partial.js:120:25)
      at Generator.next (<anonymous>)
      at evaluateSync (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/gensync/index.js:244:28)
   @ multi ./src/main/index.dev.js ./src/main/index.js main[0]

  ERROR in ./src/main/index.js
  Module build failed (from ./node_modules/babel-loader/lib/index.js):
  Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/marco/webMatters/vueMatters/nuovo
/GGC/node_modules/babel-preset-stage-0/lib/index.js
      at createDescriptor (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:178:11)
      at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
      at Array.map (<anonymous>)
      at createDescriptors (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:109:29)
      at createPresetDescriptors (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/config-descriptors.js:101:10)
      at presets (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
descriptors.js:47:19)
      at mergeChainOpts (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
chain.js:320:26)
      at /home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-chain.js:283:7
      at Generator.next (<anonymous>)
      at buildRootChain (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config/config-
chain.js:120:29)
      at buildRootChain.next (<anonymous>)
      at loadPrivatePartialConfig (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/partial.js:95:62)
      at loadPrivatePartialConfig.next (<anonymous>)
      at Function.<anonymous> (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/@babel/core/lib/config
/partial.js:120:25)
      at Generator.next (<anonymous>)
      at evaluateSync (/home/marco/webMatters/vueMatters/nuovo/GGC/node_modules/gensync/index.js:244:28)
   @ multi ./src/main/index.dev.js ./src/main/index.js main[1]

┗ ----------------------------

(base) marco@pc01:~/webMatters/vueMatters/nuovo/GGC$ vue info

Environment Info:

  System:
    OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  Binaries:
    Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node
    Yarn: 1.22.4 - /usr/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm

I attach here the package.json file :
package.txt

and the webpack.config.js file :
webpack.config.txt

How to solve the problem? Looking forward to your kind help. Marco

xnetcat commented 4 years ago

Hi, change this line of code compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync to this compilation.compiler.hooks.afterEmit.tapAsync in .electron-vue/dev-runner.js