Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Error: require('fs').readdirSync( "/", { encoding: "utf8", withFileTypes: true } ) #938

Closed

Description

@la9527

pkg problem has been found. Please solve this problem.

  • my system is 'macOS catalina 10.15.3'.
  • node 12.16.3
  • pkg version 4.4.8

code)

require('fs').readdirSync( "/", { encoding: "utf8", withFileTypes: true }

exception)

pkg/prelude/bootstrap.js:776
      if (entity[STORE_BLOB] || entity[STORE_CONTENT]) return new Dirent(entry, 1);
                ^

TypeError: Cannot read property '0' of undefined
    at pkg/prelude/bootstrap.js:776:17
    at Array.map (<anonymous>)
    at getFileTypes (pkg/prelude/bootstrap.js:773:20)
    at Object.fs.readdirSync (pkg/prelude/bootstrap.js:841:42)
    at Object.<anonymous> (/snapshot/test_program/index.js:1:90)
    at Module._compile (pkg/prelude/bootstrap.js:1320:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)

issue_readdirSync_withFileType.zip

Thank you for making a good program.

Activity

  1. hjyssg commented on Dec 20, 2020

    @hjyssg

    This bug happened on windows as well.
    May I ask when this will be fixed?

  2. albanm commented on Feb 4, 2021

    @albanm

    I looked at this commit from the pending pull request, and deduced that the problem is specific to reading root paths. Indeed, c:\ breaks but c:\test is ok.

    Reviewing and merging the pull request would be greatly appreciated, it seems to provide a very straightforward fix.

  3. dverzolla commented on Mar 12, 2021

    @dverzolla

    @albanm having the same trouble here on Windows.
    When reading from c:\ the error is trigged, when reading from c:\windows works smoothly.

    I know the guys from vercel are freaking busy, however, would some one take attention for this bug?

    @igorklopov @leo @robertsLando

    Just to mention:
    fs.readdir() is buggy as well.
    fs.promises.readdir() is working fine.

  4. robertsLando commented on Mar 12, 2021

    @robertsLando
    Contributor

    @dverzolla I'm not a maintainer, @leerob could you give a look at #992

  5. leerob commented on Mar 12, 2021

    @leerob
    Contributor

    Thanks, I've just merged the PR. #992

    To clarify, we are looking for maintainers of this package! I'm helping answer things in my free time. If you'd be interested in helping maintain, please message me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions