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

JavaScript error in main process #225

Closed
isaacs opened this issue Jul 18, 2016 · 30 comments
Closed

JavaScript error in main process #225

isaacs opened this issue Jul 18, 2016 · 30 comments
Labels
help wanted Contributions wanted towards the issue ‼️ Priority: OMG Maximum Issue needs to be seen to immediately. Like now. Please. ⚠️ 🐛 Type: Bug Issue pertains to something wrong within Hyper

Comments

@isaacs
Copy link

isaacs commented Jul 18, 2016

Seems to be triggered by the hypterterm-1password plugin, so it might be a problem with that extension. Figured I'd share it anyhow, since probably this shouldn't be possible anyway.

Uncaught Exception:
Error: watch /Users/isaacs/.node-spawn-wrap-24946-c86a459da0b6 ENOENT
    at exports._errnoException (util.js:949:11)
    at FSWatcher.start (fs.js:1433:19)
    at Object.fs.watch (fs.js:1460:11)
    at Gaze._watchDir (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:288:30)
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:357:10
    at iterate (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:78:11
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:422:5
    at iterate (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:78:11
@SamVerschueren
Copy link

Getting the exact same error when I try to use nyc

$ nyc ava

@johanbrook
Copy link
Contributor

I got this after installing hyperterm-colors and hyperterm-spacegray:

skarmavbild 2016-07-25 kl 23 21 26

This was for a first time install, couldn't repro for subsequent installs of the plugins.

@timothyis timothyis added 🐛 Type: Bug Issue pertains to something wrong within Hyper help wanted Contributions wanted towards the issue labels Jul 26, 2016
@xjamundx
Copy link

xjamundx commented Aug 11, 2016

Yeah @SamVerschueren. I get this error right now and I'm running ava in another window (not-hyperterm).

@matheuss
Copy link
Member

matheuss commented Sep 1, 2016

Since this has been reported a multiple times, I'm going to mark it as Priority: High.

Related/duplicates: #357, #401, #444, #542, #564, #587, #680

@matheuss
Copy link
Member

matheuss commented Sep 1, 2016

Anyone have any insight on this? Can this exception be safely ignored?

@isaacs
Copy link
Author

isaacs commented Sep 2, 2016

I no longer believe that this is related to hypterterm-1password. It's definitely got something to do with spawn-wrap and nyc. Not clear how those are causing this error, though.

@SamVerschueren
Copy link

I have the same issue with nyc without the 1password plugin.

@ashaw93
Copy link

ashaw93 commented Sep 6, 2016

I have the same error without any plugins :(

@whitelynx
Copy link

@isaacs If #587 and #444 actually are duplicates of this (as @matheuss has suggested by closing them in favor of this), then it doesn't even seem related to either nyc or spawn-wrap directly; the paths /Users/hq/.hyperterm_plugins/node_modules/.staging (from #587) and /Users/iradchenko/.google-cloud-sdk.staging (from #444) seem unrelated. I know I've gotten this type of error without ever using nyc; I'm pretty sure I don't have any projects on my system which use Istanbul.

It does seem like @rauchg's comment on #542 might be our best lead, since gaze does seem to be the common source of these errors, and it seems that it's watching files it shouldn't be. (ones outside the HyperTerm config directory)

@whitelynx
Copy link

Pretty sure this is because we don't handle the error event from gaze. According to @shama's comment on #542, the bug was fixed on gaze's side, but that just means the error now gets emitted from the gaze object, instead of being unhandled on the FSWatcher object. We still need to handle that event in HyperTerm's code, or it will crash the process in the same way.

@inancgumus
Copy link

inancgumus commented Sep 12, 2016

#706 Another one, probably dup, and originating from .hyperterm_plugins with _slightly_ different exception stack.

@isaacs
Copy link
Author

isaacs commented Sep 12, 2016

@whitelynx Ah, that's interesting! I wonder if gaze is incorrectly watching files that are being created in the home directory by spawn-wrap in folders like ~/.node-spawn-wrap-xxxxxx, and then when the process ends and those files disappear, it freaks out with an ENOENT.

@brandondoran
Copy link

I'm getting this with nyc as well. Here's my stacktrace:

Uncaught Exception:
Error: watch /Users/brandon/.node-spawn-wrap-57998-93b051b6d4bb ENOENT
    at exports._errnoException (util.js:949:11)
    at FSWatcher.start (fs.js:1433:19)
    at Object.fs.watch (fs.js:1460:11)
    at Gaze._watchDir (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:288:30)
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:357:10
    at iterate (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:78:11
    at /Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:422:5
    at iterate (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at Object.forEachSeries (/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:83:3)

@isaacs
Copy link
Author

isaacs commented Sep 15, 2016

I was able to work around this with the following patch:

diff --git a/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js.original b/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js
index fe80d80..b684d35 100644
--- a/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js.original
+++ b/Applications/HyperTerm.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js
@@ -296,9 +296,9 @@ Gaze.prototype._watchDir = function (dir, done) {
           done(null, dir);
         }
       }, delay + 100);
-    })
+    }).on('error', function (err) {})
   } catch (err) {
-    return this._handleError(err);
+    return this
   }
   return this;
 };

Not sure if this is helpful, or should be sent upstream to gaze, or what.

@ashaw93
Copy link

ashaw93 commented Sep 16, 2016

This commit on gaze seems to fix the error:
shama/gaze@2641016

I have hacked it in manually to my Hyperterm installation and seemed to be working like a charm.

@krzkaczor
Copy link
Contributor

krzkaczor commented Sep 20, 2016

@H1rag4mi patched it manually and now it seems to fail only when hyperterm is in the background but still issue exists.

@vors
Copy link
Contributor

vors commented Sep 25, 2016

Got the same, when hyperterm was in the background
image

@tleunen
Copy link

tleunen commented Oct 10, 2016

Same error, also when using nyc.

Uncaught Exception:
Error: watch /Users/tommy.leunen/.node-spawn-wrap-14935-c1542e645938 ENOENT
    at exports._errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1439:19)
    at Object.fs.watch (fs.js:1466:11)
    at Gaze._watchDir (/Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:288:30)
    at /Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:357:10
    at iterate (/Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at /Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:78:11
    at /Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/gaze.js:422:5
    at iterate (/Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:69:5)
    at /Applications/Hyper.app/Contents/Resources/app/node_modules/gaze/lib/helper.js:78:11

@tleunen
Copy link

tleunen commented Oct 11, 2016

@H1rag4mi I made the fix on my local app and I still have the errors :/ Looks like what @krzkaczor describes...

@jcoetzee
Copy link

jcoetzee commented Oct 14, 2016

Don't know if this helps but I just got the same error when mving a directory just after creating it. Furthermore subsequent calls to mkdir often (but not always) throw the exception as well. I can reproduce it on my machine; although I sometimes have to do the mv multiple times to trigger. Also note every subsequent exception references the original dir (the one that was mved). OS X 10.11, HyperTerm 0.8.1.
screen shot 2016-10-14 at 12 11 49 pm
Steps to reproduce:

~ $ mkdir test
~ $ mv test/ test2 #Throws exception referencing ~/test
# sometimes I need to `mv test2/ test3`, etc to reproduce.
~ $ mkdir test3 #Throws exception referencing ~/test as well

@matheuss matheuss added ‼️ Priority: OMG Maximum Issue needs to be seen to immediately. Like now. Please. ⚠️ and removed ❣️ Priority: High Issue is of High priority labels Oct 15, 2016
@rauchg
Copy link
Member

rauchg commented Oct 15, 2016

I thought we'd bumped gaze to fix this issue. We have to make sure it's at the latest.

@jcoetzee
Copy link

I can confirm that this is still present on 0.8.2 using the method I described above to reproduce.

@shama
Copy link
Contributor

shama commented Oct 17, 2016

Hmm dang, I'll try @jcoetzee's repro steps today and see what's up.

@rauchg
Copy link
Member

rauchg commented Oct 17, 2016

@shama thanks so much for following up 🎉 let me know when I should bump and release

shama added a commit to shama/hyper that referenced this issue Oct 17, 2016
chabou added a commit to chabou/hyper that referenced this issue Nov 2, 2016
* master:
  chore(package): update electron to version 1.4.5 (vercel#949)
  add onRendererWindow, because it actually available. check ./lib/utils/plugins.js:193 (vercel#924)
  increase timeout for update checks (vercel#928)
  Change URL regex - fixes vercel#867 (vercel#943)
  Make the close menu items less ambiguous
  Comply to XO's no-warning-comments rule
  Prefer default export to make XO happy (vercel#931)
  chore(package): update ms to version 0.7.2 (vercel#933)
  chore(package): update copy-webpack-plugin to version 4.0.0 (vercel#927)
  log plugins' errors in Electron console (vercel#923)
  Improve tabs title   (vercel#892)
  increase notification timeout up to 30m (vercel#913)
  Create github templates (vercel#919)
  chore(package): update electron to version 1.4.4 (vercel#907)
  Prevent Hterm to share same preferences between instances (vercel#906)
  0.8.3
  0.9.0
  Revert "Quick full screen (vercel#803)"
  Ignore file watch errors. Fixes vercelGH-225 (vercel#893)
@limeandcoconut
Copy link

Is there any progress on this? I'm my office is still getting a version of this error.

@ashaw93
Copy link

ashaw93 commented Dec 2, 2016

I'm also getting it, especially when doing a make and many files are being created and deleted 😟

@rauchg
Copy link
Member

rauchg commented Dec 3, 2016 via email

@c-lliope
Copy link

c-lliope commented Dec 3, 2016

I'm on Hyper 0.8.3.873, and I just got a similar error when trying to customize my startup shell command.

I was able to get a minimal reproduction of the error by setting:

 shell: 'bash -c /bin/bash'

in ~/.hyper.js. That same command works when I run it in an existing shell.

The error dialog:

blank_skitch_document

Stacktrace:

Uncaught Exception:
Error: spawn bash -c /bin/bash ENOENT
    at Object.exports._errnoException (util.js:1026:11)
    at Socket.<anonymous> (/Applications/Hyper.app/Contents/Resources/app/node_modules/child_pty/lib/child_pty.js:103:15)
    at Socket.g (events.js:286:16)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20)

@lclalalalala
Copy link

I get this error for a long time. But sometimes, when the network is in good condition. It works. Nothing was changed with hyper.

@thesublimeobject
Copy link

thesublimeobject commented Jan 5, 2020

was there ever an official fix for this? i've been getting this error off and on for months now, and i can't seem to find a working fix for it? it seems to happen most often—at least as far as i can tell—when i have some dir or another open in hyper, and i create a new dir, delete a dir, etc. so it seems linked in some way to the watch process (obviously, i guess), and the ability to refresh the current contents of the dir. i specifically noticed this, and have been able to recreate it, when i—for example—navigate to a particular dir and then add a dir through the finder.

realistically, this wouldn't be that big of a deal, except that sometimes it just seems to get caught in a loop in itself, and once i hit "OK" the error just comes up again, and again, and again, until i just force quit the application and restart it.

i'm on the most recent version of hyper, and my plugins are as follows—

"dependencies": {
    "hyper-blink": "latest",
    "hyper-material-vibrancy": "latest",
    "hyper-stylesheet": "latest",
    "hyperminimal": "latest",
    "hyperborder": "latest",
    "hyper-search": "latest"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions wanted towards the issue ‼️ Priority: OMG Maximum Issue needs to be seen to immediately. Like now. Please. ⚠️ 🐛 Type: Bug Issue pertains to something wrong within Hyper
Projects
None yet
Development

No branches or pull requests