New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memfs breaks with fs-extra^10.0.0 #803
Comments
This is related to jprichardson/node-fs-extra#887 |
While jprichardson/node-fs-extra#953 might address this such that Putting in simply, without |
PRs are always welcome :) |
@G-Rath, assuming it's not a NodeJS <9.2.0 issue, I am unable to replicate it using NodeJS 14 with const assert = require('assert');
const memfs = require('memfs'); // memfs@^3.4.1
assert(typeof fs.realpath.native === 'function'); // is fine, not undefined
const fse = require('fs-extra'); // fs-extra@^10.0.1 - is fine, no errors as claimed Might need more details from @Phillip9587. |
@Phillip9587, can you do a
That would help to determine the underlying cause, if its environmental issues, or narrow down to a specific dependency (in-between) that has monkey-patched You might want to check the runtime NodeJS version through |
@peteriman I'm gonna look into it on monday. Hope it was no wrong report from my side. |
@Phillip9587 Any findings so far? Nevertheless, it is likely related to Defensively patched in jprichardson/node-fs-extra#953 and released in But still, why is |
Has anyone been able to reproduce this on Node 14 or 16, using the latest version? |
I am unable to replicate it using NodeJS 14 with // pre-req
console.log(fs.realpath.native);
> [Function (anonymous)]
// memfs test
const memfs = require('memfs');
console.log(fs.realpath.native);
> [Function (anonymous)] My suspicion is with |
@peteriman Sorry for my late reply. The error originally ocurred after updating from I think your test is wrong. I tested on Nodejs 16.15.0 and got the following: // pre-req
const nodefs = require('fs');
console.log(nodefs.realpath.native);
> [Function (anonymous)]
// memfs test
const { fs } = require('memfs');
console.log(fs.realpath.native);
> undefined I don't have any time to investigate further I'm sorry.... |
@peteriman memfs 3.4.1 |
@Phillip9587 Ah, thanks for that! @G-Rath I tested @Phillip9587's code snippet. It happens on If // pre-req
const nodefs = require('fs');
console.log(nodefs.realpath.native);
> [Function (anonymous)]
// memfs test
const { fs } = require('memfs');
console.log(fs.realpath.native);
> undefined Might be related to the under-the-hood dependency, |
Defensively patched in jprichardson/node-fs-extra#953 and released in fs-extra@10.1.0. |
memfs
does not exportfs.realpath.native
. It is available since Node.js 9.2.0.https://nodejs.org/api/fs.html#fsrealpathnativepath-options-callback
fs-extra
uses univeralify to create a promise version of fs.realpath.native. Because memfs does not provide it, universalify throws a error:The error occurs even if realpath.native is not used.
The line of code:
https://github.com/jprichardson/node-fs-extra/blob/a84ef6dd8969f57d16e23267e1790def791e9a82/lib/fs/index.js#L57
The text was updated successfully, but these errors were encountered: