bun icon indicating copy to clipboard operation
bun copied to clipboard

node-tar support

Open paulll opened this issue 2 years ago • 1 comments

What version of Bun is running?

1.0.11+f7f6233ea

What platform is your computer?

Linux 6.1.59-1-lts x86_64 unknown

What steps can reproduce the bug?

import tar from 'tar'

await tar.create({
  file: '/tmp/test.tar',
  cwd: process.cwd(),
}, ['.']);

What is the expected behavior?

Should create tarball at /tmp/test.tar, like it does with node.js

What do you see instead?

❯ bun index.js
133 | 
134 |   [ONLSTAT] (stat) {
135 |     this.statCache.set(this.absolute, stat)
136 |     this.stat = stat
137 |     if (!stat.isFile()) {
138 |       stat.size = 0
          ^
TypeError: Attempted to assign to readonly property.
      at /tmp/test/node_modules/tar/lib/write-entry.js:138:6
      at new WriteEntry (/tmp/test/node_modules/tar/lib/write-entry.js:112:6)
      at /tmp/test/node_modules/tar/lib/pack.js:334:13
      at /tmp/test/node_modules/tar/lib/pack.js:302:16
      at /tmp/test/node_modules/tar/lib/pack.js:232:6
      at /tmp/test/node_modules/tar/lib/pack.js:220:4
      at /tmp/test/node_modules/tar/lib/pack.js:213:6
      at processTicksAndRejections (:61:76)

Additional information

tar has over 10M weekly downloads and over 3K dependents

paulll avatar Nov 09 '23 16:11 paulll

Does this still reproduce for you? It works for me as of at least Bun 1.1.8 (you may need to run bun upgrade)

nektro avatar May 17 '24 23:05 nektro

Now it works for me with the last Bun

paulll avatar Jul 10 '24 12:07 paulll