-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingupholdedReal issues without formal reproductionReal issues without formal reproduction
Description
- I'd be willing to implement a fix
Describe the bug
When running on Node 15.4.0, the following error can occur:
node:fs:1931
const dev = BigIntPrototypeToString(stats.dev, 32);
^
TypeError: BigInt.prototype.toString requires that 'this' be a BigInt
at Number.toString (<anonymous>)
at gotStat (node:fs:1931:19)
This started happening because of this commit: https://github.com/nodejs/node/blob/8d6c2f2ada79e52ec0b376769a7d94814945bd4f/lib/fs.js#L1931
The root cause is that the fake fs
implementation doesn't correctly handle the { bigint: true }
option that the various fs.stat
functions can take:
https://nodejs.org/api/fs.html#fs_class_fs_stats
To Reproduce
$ nvm install 15.4.0
$ yarn init -2
update package.json to:
{
"name": "bug",
"scripts": {
"start": "echo test",
"bug": "yarn bug"
}
}
$ yarn
$ yarn bug
➜ yarn bug
node:fs:1931
const dev = BigIntPrototypeToString(stats.dev, 32);
^
TypeError: BigInt.prototype.toString requires that 'this' be a BigInt
at Number.toString (<anonymous>)
at gotStat (node:fs:1931:19)
at /private/var/folders/j7/mjhkhz7x15z0nmt42b5k2x980000gn/T/tmp.K9NgZraS/.pnp.js:4516:13
Screenshots
If applicable, add screenshots to help explain your problem.
Environment if relevant (please complete the following information):
- OS: OSX
- Node version 15.4.0
- Yarn version 2.4.0
Additional context
https://discord.com/channels/226791405589233664/226793713722982400/786920513238073395
daryapotanina, avevlad, Fudoshiki, franciscofabian, yqrashawn and 9 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingupholdedReal issues without formal reproductionReal issues without formal reproduction