Skip to content
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

"The first argument must be one of type string or Buffer. Received type object", after clean wrangler generate of Scala worker #55

Closed
asimpletune opened this issue Sep 24, 2021 · 5 comments

Comments

@asimpletune
Copy link

asimpletune commented Sep 24, 2021

Hi, thanks for making this.

I tried this out after generating a clean wrangler project. After wrangler generate foo, I use miniflare index.js and navigating to the url in the browser I see:

The first argument must be one of type string or Buffer. Received type object

Screen Shot 2021-09-24 at 2 58 53 PM

@mrbbot
Copy link
Contributor

mrbbot commented Sep 24, 2021

Hey! 👋 Are you able to share the full stack trace you're getting from the console?

@asimpletune
Copy link
Author

Sure, here's what's being logged:

miniflare index.js
[mf:inf] Worker reloaded! (295B)
[mf:inf] Listening on :8787
[mf:inf] - http://127.0.0.1:8787
[mf:inf] - http://192.168.0.8:8787
[mf:err] GET /: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer. Received type object
    at write_ (_http_outgoing.js:618:11)
    at ServerResponse.write (_http_outgoing.js:586:15)
    at Miniflare._Miniflare_httpRequestListener (/Users/spence/.nvm/versions/node/v12.14.0/lib/node_modules/miniflare/src/index.ts:426:18)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
GET / 200 OK (95.16ms)

@mrbbot
Copy link
Contributor

mrbbot commented Sep 24, 2021

Ah ok. I just generated a new project from the template I'm guessing you're using and it's working for me. I think this might be the same issue as #35 though, since you're using Node 12.14. Would you be able to try with Node >= 12.19?

@asimpletune
Copy link
Author

Sure, I'll give that a shot. Thanks for the fast response.

@asimpletune
Copy link
Author

That did the trick. I guess the older APIs provided by the older version of node had different type expectations. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants