"events.js:183 throw er; // Unhandled 'error' event"


#1

Hi!

My meteor app is crashing because of this unhandled exception, throw by different kind of errors, none of them coming from meteor (we have a bad openLDAP server and bad SMTP).

my question is shouldn’t meteor handle this exception and prompting an error message instead of crashing the entire app???


#2

have you tried try/catch ?


#3

yep, that’s the first thing I did, but it did’t work my guess is that this is happening asynchronous and why I can’t catch it


#4

yes, then you should use async/await

const callSomeService = async () => {
  try {
    const result = await callService();
  } catch (error) {
    // do something
  }
}

#5

Is this a production app? You can get this error if you’re using the wrong version of node.


#6

Thanks for the suggestion I’ll try it right away! :slight_smile:


#7

I get the app to crash in development and in production, the only difference is that in development meteor restarted the app. My main concern is the in production app

$ meteor node --version
v8.9.3
$ node --version
v8.9.1

do you think this version difference matters??


#8

What Meteor version is this?


#9

meteor --version
Meteor 1.6.0.1


#10

The correct versions are node 8.9.3 and npm 5.5.1

However, that doesn’t explain dev crashes.


#11

yeah, I ran meteor node --version in the wrong directory, I do have node 8.9.3


#12

I implemented your suggestion but I couldn’t catch any exception from events.js


#13

so is this a bug? and if it is, is it node or Meteor bug?