destiny: Error: ENOENT: no such file or directory, scandir

Hello, Recently I tried to use this amazing library and after running npx destiny -w src I got this problem:

(node:23356) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir
    at Object.readdirSync (fs.js:854:3)
    at removeEmptyFolders (C:\Users\xxxxx\AppData\Roaming\npm-cache\_npx\23356\node_modules\destiny\lib\destiny.js:170:20)  
    at formatFileStructure (C:\Users\xxxxx\AppData\Roaming\npm-cache\_npx\23356\node_modules\destiny\lib\destiny.js:351:5)  
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async run (C:\Users\xxxxx\AppData\Roaming\npm-cache\_npx\23356\node_modules\destiny\lib\destiny.js:965:5)
(node:23356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)(node:23356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I will appreciate any help.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Ok so that’s an issue with path.sep.

replacing import of "./indexApp.js" by ".\\indexApp" in "C:/Projects/MyProject/client/src/index.js"
shortest: C:/Projects/MyProject/client/src/App.js
secondShortest: C:/Projects/MyProject/client/src/index.js
secondShortestParts: [ 'C:/Projects/MyProject/client/src/index.js' ] // can't be split since `path.sep` = '\' on windows
should be the shared parent: []
parentFolder:

I’m going to fix this a bit later in the day. Thank you for taking the time to run the build!

Your imports are written with forward slashes, right?

yes

If I push a custom build of Destiny (with logs that will help to debug this issue) on a new branch, would you be able to run it on your project?

yeah it’s empty

DEBUG: +716ms generated tree(s):
  [
    {
      parentFolder: '',
      tree: {