davidmyersdev / vite-plugin-node-polyfills

A Vite plugin to polyfill Node's Core Modules for browser environments.
MIT License
301 stars 22 forks source link

Writable.toWeb is not a function #56

Closed TRSescada closed 9 months ago

TRSescada commented 10 months ago

I am trying to import and work with Writable from the library stream and it says it is not a function

import {Writable} from "node:stream"; 
await readableStream?.pipeTo(Writable.toWeb(writeStream));

here is my vite.config.js :

import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
  plugins: [
    nodePolyfills({
      overrides: {
        fs: 'memfs',
      },
    }),
  ],
})

ps: i have tried to override as well for stream and got this issue : GET http://URL.... 504 (Outdated Optimize Dep)

davidmyersdev commented 10 months ago

Would you mind adding a StackBlitz or CodeSandbox reproduction of this issue for me to debug?

davidmyersdev commented 9 months ago

Closing due to lack of activity/reproduction.