question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

creates undefined directories

See original GitHub issue

Was comparing memfs and memory-fs and was failing a test. Discovered that memfs will create undefined directories when you fs.mkdirSync("/"); and that directory already exists.

// test.js
const {Volume} = require("memfs");

var fs = new Volume();

// snippet from https://github.com/webpack/memory-fs/blob/master/test/MemoryFileSystem.js#L18
fs.mkdirSync("/test");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/test//sub/");
console.log(fs.readdirSync("/"));
fs.mkdirpSync("/test/sub2");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/root\\dir");
console.log(fs.readdirSync("/"));
fs.mkdirpSync("/");
console.log(fs.readdirSync("/"));
fs.mkdirSync("/"); // <-- this should probably throw; creates an "undefined" folder instead
console.log(fs.readdirSync("/")); // --> [ 'root\\dir', 'test', 'undefined' ]
$ node test.js
[ 'test' ]
[ 'test' ]
[ 'test' ]
[ 'root\\dir', 'test' ]
[ 'root\\dir', 'test' ]
[ 'root\\dir', 'test', 'undefined' ]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
streamichcommented, Feb 9, 2019

🎉 This issue has been resolved in version 2.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

0reactions
streamichcommented, Feb 10, 2019

Im memfs stream implementation is copied from Node almost verbatim.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Starting IDE creates "undefined" folder in current directory #394
Steps to reproduce the behavior: Start the IDE; go to home folder; be happy with "undefined" folder ... Just giving it a more...
Read more >
Create folder returns undefined when trying to find file id
This code returns undefined for the id of the folder. I don't want to use the list method to search the drive after...
Read more >
Installed a program into an undefined folder
The new program is not listed under All Programs. I can only start it by clicking on the program in the Computer directory....
Read more >
Undefined folder in File Browser - JCE Editor
Hi, I'm using JCE Editor Core 2.8.6 with Joomla 3.9.15 and Chrome and I'm experiencing a strange behaviour using File Browser.
Read more >
Failed to create folder. (Undefined index: expiry) - FileRun
I get this when trying to create the original superuser directory. I'm sure it's a PHP write issue, but how do I go...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found