[Gulp Issue (?)] Potentially unhandled rejection [2] Error: ENOENT, open

Okay, so, I had this issue before and didn’t really get a resolution here. It was on a fresh install, so, I ended up just nuking it and starting over and the issue didn’t come back – however I’m quite a ways into a different site now and the error has randomly appeared. I’ve been using Roots the very same way I am now without any issue for a few years, this is something new that’s happened to me since 8.0.0.

Essentially I randomly get this error:

Potentially unhandled rejection [2] Error: ENOENT, open ‘/srv/users/serverpilot/apps/sportobin/public/wp-content/themes/sporto/assets/styles/main.less’

Then once that happens, it won’t process the styles – see this:

[15:55:59] Starting ‘wiredep’…
[15:55:59] Finished ‘wiredep’ after 407 ms
[15:55:59] Starting ‘styles’…
[15:56:01] Starting ‘wiredep’…
[15:56:01] Finished ‘wiredep’ after 87 ms
[BS] 2 files changed (main.css, editor-style.css)
[15:56:08] Finished ‘styles’ after 8.16 s
[15:59:03] Starting ‘wiredep’…
[15:59:03] Finished ‘wiredep’ after 34 ms
[15:59:03] Starting ‘styles’…
[15:59:04] Starting ‘wiredep’…
Potentially unhandled rejection [2] Error: ENOENT, open ‘/srv/users/serverpilot/apps/sportobin/public/wp-content/themes/sporto/assets/styles/main.less’
[BS] Reloading Browsers…
[15:59:07] Finished ‘wiredep’ after 2.85 s
[16:02:22] Starting ‘wiredep’…
[16:02:22] Finished ‘wiredep’ after 23 ms
[16:02:22] Starting ‘wiredep’…

If I stop gulp watch, and, restart it it will work exactly once – then I get the same error again the process starts over again of just simply doing “wiredep” processes.

My workflow is pretty simplistic, I setup a terminal window and leave gulp watch running – then I edit the files with Sublime Text via Transmit and simply “Save” the file, let it upload, let gulp do the work, and wait for the reload – which is how I’ve done it (with grunt) for quite a while.

I’m quite a ways into this front end, so, ideally I’d like to salvage this vs having to move files around etc.

Any ideas? (and thank you!!)

EDIT: I’ll also add if I just run “gulp” it’s completely fine, it only happens when I run “gulp watch” on the second process.

You are working on files locally, and then having them uploaded to a server where gulp is running?

Yeah, that’s essentially how it works I’m sure. I open them in my FTP client – and then it reuploads them. I’ve done that for ages without issue. Is that a problem now? :slight_smile:

The last time I had this happen (again on 8+ only) it was right off the bat – now it seems to have randomly happened about 80 saves in, not sure what changed. It was working great.

I don’t know. Sage (and Roots ever since Grunt was implemented) was meant to be run locally.

gulp watch is running Browsersync, which is doing a lot. And is not necessary on a server.

Does gulp or gulp --production work?

Yep! gulp and gulp --production work completely fine, it’s only watch. I’d rather have it on my server to be honest vs running it locally – is there anything I can disable to make it work?

Confused as to how it just randomly started doing this though.

And to be clear, it works exactly once every time I do gulp watch – then on the second time it fails.

Example:

[16:16:14] Starting ‘wiredep’…
[16:16:14] Finished ‘wiredep’ after 461 ms
[16:16:14] Starting ‘styles’…
[16:16:15] Starting ‘wiredep’…
[16:16:16] Finished ‘wiredep’ after 103 ms
[BS] 2 files changed (main.css, editor-style.css)
[16:16:22] Finished ‘styles’ after 7.95 s
[16:19:37] Starting ‘wiredep’…
[16:19:37] Finished ‘wiredep’ after 28 ms
[16:19:37] Starting ‘styles’…
[16:19:38] Starting ‘wiredep’…
Potentially unhandled rejection [2] Error: ENOENT, open ‘/srv/users/serverpilot/apps/sportobin/public/wp-content/themes/sporto/assets/styles/main.less’
[16:19:41] Finished ‘wiredep’ after 2.89 s