TypeScript error with `WriteStream`
See original GitHub issueDescribe the bug
Described in the title.
Steps to Reproduce
import { WriteStream } from "https://deno.land/std@0.164.0/node/fs.ts";
if (something instanceof WriteStream) {
something.path // ts error
}
Expected behavior
Should behave like /std@0.155.0/node/fs.ts.
Environment
N/A
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Node/Typescript: How to close a writestream in the process ...
There is a section in the code when await log('CLOSE_STREAMS') is called to run the WriteStream#close() functions on each WriteStream, ...
Read more >WriteStream | typescript - v3.7.7
new WriteStream(fd: number): WriteStream. Inherited from WriteStream.constructor ... _destroy(error: Error | null, callback: function): void.
Read more >Streams, Piping, and Their Error Handling in Node.js - Medium
I am using TypeScript instead of JavaScript. import { createWriteStream } from 'fs';const writeStream = createWriteStream('./dump.txt');.
Read more >Emitted 'error' event on WriteStream instance #30738 - GitHub
I used the with-typescript example. When running npm run buid it works fine but when I have dev running via npm run dev...
Read more >How to handle stream errors? - Mario Kandut
When you run the code with node stream-error-emit.js from the CLI the error will be first emitted from PassThrough , and then handled...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have submitted a PR that fixes this issue in the way I had suggested. I have verified the TS error does not occur and also verified #2548 does not reoccur.
Hi,
It also reproduces in deno_std 0.156.0, so I think #2634 is the trigger. We need a way to resolve this issue without causing a recurrence of #2548.
I would like to investigate, but unfortunately will not have enough time for a while and therefore it is difficult for me to submit a PR soon. If someone would like to take on this, I would welcome it.