-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'call' of undefined #823
Comments
Not sure if that's relevant but i'm using ViteJS (https://vitejs.dev) to build the app |
That is absolutely relevant. This is an issue with circular dependencies, see nodejs/readable-stream#348 That should be resolved in future updates, but for now a work around is needed. Following that thread and some forks I currently use patch-package to apply some patches. |
Ok, thanks |
Can you share the patch that you apply to (presumably) the
|
Nvm, looks like i just had to install the |
For future reference I am using the attached file. Rename to This should only be a temporary workaround until the |
@m00nwtchr I also encountered it, and I also used vite. Do you have a solution |
it seems that original problem nodejs/readable-stream#348 has fixed, it should be gone for now. But it's not :) |
Working for me now using:
Thanks @m00nwtchr for: Fake process for the browser:
Add this to your vite.config.ts:
Think that's most of what I did, good luck! |
See nodejs/readable-stream#348 and feross/simple-peer#823 This commit will probably be reverted in near future when nodejs readable stream will be compatible with vite
Throwing in a piece of info that wasn't obvious to me, since it might save a bit of someone's time: If in your vite.config you've set up something like this during development
then it will work during development, but will break in production build, since Vite uses separate build pipelines for development (esbuild) and production (Rollup). @remaininlight's workaround worked perfectly for production and didn't break development server (thanks!) Upstream issue was closed as completed indeed, but it isn't immediately clear if the issue was really fixed in the readable-stream codebase itself, couldn't find any references of it in the changelog. Maybe the 4.x release? Currently simple-peer uses 3.x. |
Hi! can you tell me do you solve this problem at last? |
I get this error when using the lib in the browser:
the stack trace is obfuscated but the line it points to seems to be in the
readable-stream
module. (i think its this one? https://github.com/nodejs/readable-stream/blob/master/lib/_stream_duplex.js#L60)Code:
The text was updated successfully, but these errors were encountered: