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
Error: The first argument must be of type string or an instance of Buffer. Received an instance of Uint8Array #35
Comments
Hello! 👋 Could you send the rest of the stack trace? Your code is working for me locally. 😕 |
Let me know if you need more details. Happy to provide.
|
Hmmm, interesting. I can see the problem there, but I'm confused why I'm not seeing this. Which version of Node are you using? |
Looks like support for writing |
I’m on node 12.6 actually
|
😆 Ok, looks like this was actually fixed in Node 12.19.0: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#2020-10-06-version-12190-erbium-lts-codebytere
|
That was it! Thanks so much, for your help and the great tool. |
No worries! Thank you! 😄 |
I'm on node v14 and I also get this.
I have followed the instructions on https://miniflare.dev/cli.html, so here's the summary: Installed with:
Then I added a
Then run it with:
All good so far. When I hit http://127.0.0.1:8787/ I get this in the log, and the following image in the browser:
I'm fine playing with things or looking into it further for you but just thought I'd mention it here in case anyone else was having the same problem. Btw, it's all exactly the same on v16. I'm using |
I've deleted this comment since it was incorrect. Summary: I said both v14 and v16 were still not working, but actually v16 is fine and just v14 is not working. |
I'll just edit my last comment. It seems v16 is fine, but v14 is still problematic. So, in conclusion, v16 is okay and I suspect that should be the version that goes into the docs, rather than v14 as previously suggested further up. |
Hey! 👋 Thanks for looking into this. Miniflare 2 is going to have a hard requirement on Node 16 anyways for its built-in web standards (e.g. streams, crypto, ...) so this shouldn't be a problem once that's published. |
Ok, thanks. :) |
Getting the error "The first argument must be of type string or an instance of Buffer. Received an instance of Uint8Array"
worker.js:
addEventListener("fetch", (event) => { event.respondWith(new Response("Hello Miniflare!")); });
running:
npx miniflare worker.js
The text was updated successfully, but these errors were encountered: