question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render process async/await error not output in console

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
dspangenbergcommented, Nov 17, 2018

@nklayman For example in main.js

2reactions
dspangenbergcommented, Nov 16, 2018

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)
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

async await is not working and console not returning an error
1 Answer 1 ... You don't return anything from RaceInfo , and race is undefined in callback passed to RaceInfo().then(...) ...
Read more >
Common Mistakes in JavaScript Async Function Error Handling
1. Error thrown from async function is a rejected promise · 2. Async function as a param.
Read more >
javascript - await does not wait for Promise to finish
So it's a bit weird. The "waiting" happens within that aync function, not your initial js function. consider this example
Read more >
Async Await JavaScript Tutorial – How to Wait for a Function to ...
Failing to provide the async keyword will result in a syntax error when trying to use await inside a regular function. Because of...
Read more >
Async/Await Error Handling - Beginner JavaScript - Wes Bos
Go into our playground and copy the async-await.html file and rename it to async-await-error-handling.html . Go and delete everything except for these two ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found