We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.0.25+a8ff7be64
Linux 5.19.0-38-generic x86_64 x86_64
https://gist.github.com/tekknolagi/3ba5c6a5bea8e87742642fbb68aba6ef
Run bun run transform.js main.js
bun run transform.js main.js
main.js now contains
#!/usr/bin/env node foo bar const fs = require('fs'); const path = require('path'); const assert = require('assert');
(note the "foo bar")
A bunch of leading 0s:
cedar% xxd main.js 00000000: 2300 0000 0000 0000 0000 0000 0000 0000 #............... 00000010: 0000 0000 0000 0000 0000 000a 636f 6e73 ............cons 00000020: 7420 6673 203d 2072 6571 7569 7265 2827 t fs = require(' 00000030: 6673 2729 3b0a 636f 6e73 7420 7061 7468 fs');.const path 00000040: 203d 2072 6571 7569 7265 2827 7061 7468 = require('path 00000050: 2729 3b0a 636f 6e73 7420 61 ');.const a cedar%
No response
The text was updated successfully, but these errors were encountered:
Running bun upgrade gets me to 1.1.3+2615dc742 which still has this issue.
bun upgrade
1.1.3+2615dc742
Sorry, something went wrong.
Simplified repro:
const fs = require('fs/promises'); (async () => { const fd = await fs.open("out.txt", "w+"); await fd.writeFile("x"); await fd.writeFile("x"); await fd.close(); })();
node writes xx, bun writes x. This is probably because we're not correctly updating the file offset to write to
xx
x
writeFileSync
fs.writeFileSync
Thanks for reporting the issue!
gvilums
Successfully merging a pull request may close this issue.
What version of Bun is running?
1.0.25+a8ff7be64
What platform is your computer?
Linux 5.19.0-38-generic x86_64 x86_64
What steps can reproduce the bug?
https://gist.github.com/tekknolagi/3ba5c6a5bea8e87742642fbb68aba6ef
Run
bun run transform.js main.js
What is the expected behavior?
main.js now contains
(note the "foo bar")
What do you see instead?
A bunch of leading 0s:
Additional information
No response
The text was updated successfully, but these errors were encountered: