I have experienced a lot of errors in the packager (that literally crashes it) everytime I'm developing.
The crash seems to occur here:
https://github.com/facebook/react-native/blob/88a92f8f52ce68eae26d473e8091f0032c885c00/local-cli/server/server.js#L108
Because _error_ seems to be undefined.
Everytime the crash occurs, there's an error before
with random files.
Process Monitor logs "file locked" on those files when the error occurs.
I managed to stop the server from crashing by adding a check for undefined _error_ and returning if it occurs, but that doesn't seems to be a real fix for me. I don't understand why error callback fires with undefined errors too.
Also, removing react.gradle from the gradle project and making a custom build script (downloading from the packager to the right dest with curl) helped.
Project "Rebuild" also triggers some of these errors (at least i think its related) but this time inside gradle... I'll try to get a stacktrace for this one.
Also... its the default project structure/files (from react-native init)
Any ideas?
This is what I've added to the exception handler:
if (typeof error === 'undefined') {
reject();
return;
}
to void crashing:
Yeah, I'm having the same issue, particulary with .idea or .hg directories.
The exception:
ERROR EPERM: operation not permitted, lstat '...\.hg\wlock-2d06a916'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"...\\.hg\\wlock-2d06a916"}
Error: EPERM: operation not permitted, lstat '....\.hg\wlock-2d06a916'
at Error (native)
It's occuring so frequently that I've resorted to commenting the process.exit(1); line in the uncaughtException handler.
I'm going to dig a bit deeper into the file watching to see if I can dig something up.
@kwaak It's not only those folders... I've commented the process exit too. Impossible to use packager without it...
I believe that's the same issue:
https://github.com/nodejs/node-v0.x-archive/issues/4337
You can also use watchman
Closing this issue out for now, as some workarounds were provided here, including using watchman which is recommended on other platforms as well.
Feel free to reopen if this issue still persists!
@WoLfulus where to add the exception handler?
@jsierles using watchman no longer helps
+1
This is still a bug.
Most helpful comment
This is still a bug.