Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Errors Message Information #17

Open
mikecbone opened this issue Mar 5, 2020 · 4 comments
Open

Unhandled Errors Message Information #17

mikecbone opened this issue Mar 5, 2020 · 4 comments

Comments

@mikecbone
Copy link

Adding unhandled() to my electron application, when getting an error message I don't seem to get relevent helpful information as compared to the example. Instead I get a NonError, which I do not understand. The stack trace doesn't appear to reference any code I've written. This is for any error I get that pops up.

I appologise if this is working as intended. If so then some clarification would be appreciated!

I am using Electron 7, with Vue & Vue-Router. I have added unhandled in my main.js and my App.vue.

Example error:

Unhandled Error
NonError: ErrorEvent { isTrusted: [Getter] }
    at module.exports (C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/ensure-error/index.js:14:10)
    at handleError (C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/electron-unhandled/index.js:24:10)
    at C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/electron-unhandled/index.js:83:4
    at invokeFunc (C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/lodash.debounce/index.js:160:19)
    at trailingEdge (C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/lodash.debounce/index.js:207:14)
    at timerExpired (C:/Users/DefProc Engineering/AppData/Local/Programs/gh-record/resources/app.asar/node_modules/lodash.debounce/index.js:195:14)
@sindresorhus
Copy link
Owner

Are you sure you're on the latest version? A similar case was fixed in fc0585d.

This can also happen when you have strict CSP that doesn't allow getting the error information. Related: https://stackoverflow.com/questions/46422290/webpack-dev-server-react-content-security-policy-error

@mikecbone
Copy link
Author

I should be on the latest version "electron-unhandled": "^3.0.2",!

Not sure about CSP. As far as I can tell Vue doesn't force CSP, and I'm not sure what else would.

The vue-electron plugin I'm using sets up webpack but I don't have a webpack.config file and I'm not currently sure about how it goes about using it.

@janakg
Copy link

janakg commented Aug 16, 2020

@DotoPototo facing the same issue with a similar stack trace. Did you find any solution?
Using the latest version v3.0.2

@laudenberg
Copy link

Here is the smallest test case I could come up with to get this kind of error. It seems to me that the video element has to be too large to fit on screen and be initially hidden.

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Hello World!</title>
</head>
<body>
  <button onClick="go()">Click me</button>
  <div id="wrapper" style="display: none;">
    <video id="video" width="10000" height="10000" controls muted></video>
  </div>
</body>
<script>
function go() {
  const unhandled = require('electron-unhandled');
  unhandled();
  document.getElementById('wrapper').style.display = 'block';
}
</script>
</html>

For completeness, this is package.json and main.js:

{
  "name": "electron-unhandled-bug",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "electron": "^9.1.0"
  },
  "dependencies": {
    "electron-unhandled": "^3.0.2"
  }
}
const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true
    }
  })

  win.loadFile('index.html')
}

app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  if (BrowserWindow.getAllWindows().length === 0) {
    createWindow()
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants