GithubHelp home page GithubHelp logo

Comments (8)

marcello3d avatar marcello3d commented on May 28, 2024

Something like this: https://github.com/amasad/sane/compare/master...marcello3d:walker-errors?expand=1

from sane.

wtgtybhertgeghgtwtg avatar wtgtybhertgeghgtwtg commented on May 28, 2024

Sorry for the late response. Do your users have examples of where this error is occurring?

from sane.

joshkel avatar joshkel commented on May 28, 2024

I've run into this too. When using Facebook's Jest in watch mode, I'll sporadically get errors similar to the following:

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: EPERM: operation not permitted, lstat 'F:\trunk\app\test\containers\RunNumberHandlerTest.js~RF236e5f90.TMP'

My diagnosis was the same as @marcello3d's (node_watcher's recReaddir -> 'error' event -> no error listener).

From what I can tell, the culprit in my case is an editor creating temporary files with ShareMode 0 (none). (See MSDN's CreateFile docs.) Node then attempts its own CreateFile call as part of its lstat implementation, and that fails.

I can reproduce the error by creating a file, changing the file permissions to deny access to everyone, then running Jest.

from sane.

amasad avatar amasad commented on May 28, 2024

@joshkel || @marcello3d patches welcome :)

from sane.

joshkel avatar joshkel commented on May 28, 2024

@amasad - I'd be happy to submit a patch, but I'm not using sane directly and am really not familiar with its design.

Should it ignore errors completely, under the assumption that callers don't assume they'll have to handle errors and that there aren't any actionable events on inaccessible or erroneous files?

Should it try to special case a couple of errors for walker, like it does for lstat?

Something else?

from sane.

marcello3d avatar marcello3d commented on May 28, 2024

How does my patch from up above look?

from sane.

amasad avatar amasad commented on May 28, 2024

@marcello3d the patch looks good. But I don't understand why should we also ignore "ENOENT"? EPERM seems to be the problem here

from sane.

marcello3d avatar marcello3d commented on May 28, 2024

I refactored the existing code into an new helper function, see https://github.com/amasad/sane/compare/master...marcello3d:walker-errors?expand=1#diff-18c7836cd56d6aee3a621e821c9c121fL223

As to why the existing code did that, I couldn't tell you. :-)

from sane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.