Skip to content
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

Cannot set property closed of #<Readable> which has only a getter in NodeJS v18.0.0 #828

Closed
ShenHongFei opened this issue Apr 20, 2022 · 5 comments · Fixed by #836
Closed
Labels

Comments

@ShenHongFei
Copy link

NodeJS v18.0.0

TypeError: Cannot set property closed of #<Readable> which has only a getter
    at FsReadStream.close (d:\0\node_modules\memfs\lib\volume.js:2047:17)
    at FsReadStream._destroy (d:\0\node_modules\memfs\lib\volume.js:2032:10)
    at _destroy (node:internal/streams/destroy:109:10)
    at class_1.destroy (node:internal/streams/destroy:71:5)
    at class_1.<anonymous> (d:\0\node_modules\memfs\lib\volume.js:1962:22)
    at class_1.emit (node:events:539:35)
    at class_1.emit (node:domain:475:12)
    at endReadableNT (node:internal/streams/readable:1344:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

caused by this.closed = true in node_modules/memfs/lib/volume.js

FsReadStream.prototype.close = function (cb) {
    var _this = this;
    if (cb)
        this.once('close', cb);
    if (this.closed || typeof this.fd !== 'number') {
        if (typeof this.fd !== 'number') {
            this.once('open', closeOnOpen);
            return;
        }
        return process_1.default.nextTick(function () { return _this.emit('close'); });
    }
    this.closed = true;
    this._vol.close(this.fd, function (er) {
        if (er)
            _this.emit('error', er);
        else
            _this.emit('close');
    });
    this.fd = null;
};
@nuintun
Copy link

nuintun commented Apr 24, 2022

Same bugs
Suggestion

@G-Rath
Copy link
Collaborator

G-Rath commented Apr 24, 2022

Pull requests are welcomed 🙂

@dsokal
Copy link
Contributor

dsokal commented May 11, 2022

@G-Rath I put up a PR to fix this - #836 I'm not sure what are the contribution guidelines, but I saw you already contributed to the repo, so I'm just letting you know.

@G-Rath
Copy link
Collaborator

G-Rath commented May 11, 2022

Awesome thanks - I've got merge powers so will take a look tomorrow morning.

@streamich
Copy link
Owner

🎉 This issue has been resolved in version 3.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants