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.

Update BlockBlobClient.uploadStream to use NodeJS.ReadableStream instead of Readable

See original GitHub issue
  • Package Name: storage-blob
  • Package Version: 12
  • Operating system: mac
  • nodejs
    • version: 14
  • browser
    • name/version:
  • typescript
    • version: 4
  • Is the bug related to documentation in

Describe the bug Due to this method using Readable type rather than NodeJS.ReadableStream type I cannot pass a standard Node.js readable stream. With this change, users can still pass Readable types to the method since it implements NodeJS.ReadableStream.

I previously tried to fix this with https://github.com/Azure/azure-sdk-for-js/pull/11483 but didn’t anticipate other methods require the Readable type. Maybe i misunderstand the difference between it and NodeJS.ReadableStream. In addition, maybe I need to do something in my own code.

In my specific instance I’m using Node.js and Busboy which defines its file type as NodeJS.ReadableStream (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/busboy/index.d.ts#L41)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jiacfancommented, Sep 25, 2020

Hey, @Ethan-Arrowood

Thanks for reaching us and good to know you have found the right approach. Yes, according to Readable’s definition, using wrap is the right approach. This is a valuable topic related to old vs new stream, and might help others as well.

Thanks, Jiachen

0reactions
jiacfancommented, Oct 21, 2020

Close the issue as it’s a node.js usage related pattern and welcome feedback if anyone hit similar isse.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BlockBlobClient class - Microsoft Learn
To perform a partial update of a block blob's, use stageBlock(string, HttpRequestBody, number, ... Uploads a Node.js Readable stream into block blob.
Read more >
I want to upload files to Blob Storage NOT AS STREAMS ...
There is a function uploadFile of BlockBlobClient that can help to directly upload a local file to Azure Blob Storage, as the figure...
Read more >
Stream | Node.js v19.3.0 Documentation
Readable streams use the EventEmitter API for notifying application code when data is available to be read off the stream. That available data...
Read more >
How to Upload PDF Files to Azure Blob Storage Using Node.js
Then, we'll call its download method with parameter 0 to access the entire file. download returns a readable stream, so I've included a...
Read more >
How To Work with Files Using Streams in Node.js - DigitalOcean
Transform streams: a duplex stream in which the output (or writable stream) is dependent on the modification of the input (or readable stream)....
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