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
[Bug] fs
patch doesn't handle { bigint: true }
#2232
Comments
Same problem with yarn 2.4.0 (zero install) and ts-node-dev. $ cat ./file-system.ts
console.log("123");
~/projects/ts-data-analysis-with-zero-install/examples on main! ⌚ 1:26:29
$ yarn ts-node ./file-system.ts
123
~/projects/ts-data-analysis-with-zero-install/examples on main! ⌚ 1:26:53
$ yarn ts-node-dev ./file-system.ts
[INFO] 01:27:04 ts-node-dev ver. 1.1.1 (using ts-node ver. 9.1.1, typescript ver. 4.1.3)
TypeError: BigInt.prototype.toString requires that 'this' be a BigInt
at Number.toString (<anonymous>)
at gotStat (node:fs:1931:19)
at /Users/darya/projects/ts-data-analysis-with-zero-install/.pnp.js:7049:13 Environment:
OS: OSX |
I started making a branch that implements that option in the FakeFS interfaces and up through all the implementers, but if y'all are working on it already you can probably do it a lot faster than I can as an outsider. |
I have a pull request open for |
I have the same issue with yarn 2.4.0 and node 15.4.0, but not with previous versions of node |
I can confirm that #2262 fixes it. It can be used via:
Make sure to run |
Yarn 2 has this bug with Node 15. The bug is fixed in a branch that hasn't been published yet. The choice was between `yarn set version from sources --branch 2262` and then remember to switch back to main at some later date, or just use Node LTS. I opted for stability. yarnpkg/berry#2232
@arcanis I'm facing the following issue with node 15.10.0, but not in 14.16.0:
Is this related to this issue? ( |
Yes, see #2232 (comment) |
@arcanis Odd, I'm still getting this issue with the latest yarn (2.4.1), even though it's been released only few weeks ago, and the PR was merged in December. Maybe the relevant packages weren't upgraded in the release? |
The 2.4.1 only includes a TS compat fix. It'll be part of the 3.0, which takes a bit of time due to me being on vacation at the moment - will release when I'm back. |
Is there by any chance an up-to-date branch? It seems this one is missing other critical updates that were already in 2.4.1. Seems related to a Typescript patch I saw referenced in another issue.
Output of
|
Curious... is there a scale to a bit of time? :) days, weeks, months? |
Since it has been merged
|
That fixed the issue. Thanks! |
This worked! Just remember to |
Any chance of this getting ported into the 2.4 branch or will it only ship in 3.0? |
It has been released in 3.0.0-rc.1 and 3.0.0-rc.2, no plans to backport it |
This comment has been minimized.
This comment has been minimized.
But actually nothing wrong in this comment. I tired of various bugs and Python-like situation (1 or 2, ), missing IDE support for PNP and switched to PNPM (strict resolve as Yarn 2 does without broken IDE support and without introducing non-standard elements to workflow (no need to put yarn 2 under project, no need to use special CLI to install plugins and so on)). |
Nothing good either, which is just as annoying. An issue tracker isn't the right device to vent your frustrations. Be productive, or don't be here. Also note that it literally takes one command to use the RELEASE CANDIDATE version, which includes the fix. If you don't wish to use it fine, but have the elegance to skip posting meme gifs on this bug tracker. |
Describe the bug
When running on Node 15.4.0, the following error can occur:
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 variousfs.stat
functions can take:https://nodejs.org/api/fs.html#fs_class_fs_stats
To Reproduce
Screenshots
If applicable, add screenshots to help explain your problem.
Environment if relevant (please complete the following information):
Additional context
https://discord.com/channels/226791405589233664/226793713722982400/786920513238073395
The text was updated successfully, but these errors were encountered: