microsoft / microsoft/node-api-dotnet

Streams are broken in electron

Open
#433 0 comments 0 reactions 1 assignee View on GitHub

@vmoroz is already working on this.

Since Mar 14, 2025.

Dominant language
C#
Stars
783
Forks
80
PR merge metrics
No merged PRs in 30d

Description

I have the following trivial method:

public static Stream TestStream()
{
    return new MemoryStream(System.Text.Encoding.UTF8.GetBytes("hello"));
}

I'm noticing a different behavior when I use it in Electron compared to Node.js - even though there's no error, the Electron version appears empty:

console.log(MyClass.testStream().read()); // null in electron, Buffer in Node.js

Potentially related to https://github.com/microsoft/node-api-dotnet/issues/383, although I'm unsure if this implementation somehow uses external buffers?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.