question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript error with `WriteStream`

See original GitHub issue

Describe 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:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
PolarETechcommented, Nov 20, 2022

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.

1reaction
PolarETechcommented, Nov 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found