vue-cli-plugin-electron-builder: Render process async/await error not output in console

Describe the bug The error happened inside the async/await cannot be output int he electron console, only can output correctly outside the async/await scope or try/catch the error and console.log manually.

To Reproduce

  1. After vue create testvuecli3electron & yarn & yarn electron:serve, I can see Electorn app run successfully
  2. Add the scripts as below in the Home.vue
  async mounted() {
    console.log("before");
    await console.log("await");
    const a = b.c;
    console.log("finish");
  }
  1. There is no any error output in the console.(refer to below screenshot)

Expected behavior Display the same error as in browser console.

Screenshots image

Environment (please complete the following information):

  • OS and version: 10.12.6
  • Node version: v8.11.4
  • npm version: 6.4.0
  • yarn version (if used): 1.9.4
  • vue-cli-plugin-electron-builder version : 1.0.0-rc.4
  • other vue plugins used: (no)
  • custom config for vcp-electron-builder: (no)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

@nklayman For example in main.js

I have the same problem with Electron 3. But “only” in development mode. In production, the errors will be logged to console.

For the time being use:

process.on('unhandledRejection', error => {
  console.error(error)
})

On my side I have a Uncaught TypeError: process.on is not a function error when adding it.

Any thoughts?

Thanks.