-
Notifications
You must be signed in to change notification settings - Fork 29
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
TypeError: Read error for undefined : buffer[bufferReader] is not a function #124
Comments
You need to pass a Node.js |
I was afraid something like that would be the case. This unfortunately makes using it purely on the frontend very inconvenient. Thanks anyways. |
If you want to use prismarine-nbt (a nodejs library) on the web you will need to transpile to something browser compatible as with any other Node.js library. Tool like browserify or webpack can do this. Those will implement the Node.js Buffer object that you can then instantiate to pass into prismarine-nbt. We also have a section on this in the readme https://github.com/PrismarineJS/prismarine-nbt?tab=readme-ov-file#browser-usage |
Since this has been brung up a few times (eg #56), we could do some sanity check before and maybe some conversion inside |
I'm getting the above issue when trying to include prismarine-nbt in a svelte / vite frontend web project.
My relevant code snippet:
using the same code (but with callbacks instead of async/await) it works fine with nbt.js, however it's a no longer maintained project so I'd very much prefer to use this one instead.
The text was updated successfully, but these errors were encountered: