-
Notifications
You must be signed in to change notification settings - Fork 156
[ BUG ] TypeError [ERR_INVALID_ARG_TYPE] #317
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
Comments
stack
|
Hi @waleedarshad-vf, just giving you a heads-up that I will look into this this weekend. Not ignoring you, just busy hunting for a new job. |
Thanks |
@waleedarshad-vf I'm going to need more than a stacktrace to debug this. Please provide a minimal reproducible test case and the version of node you are on. |
@derduher I just followed simple steps
|
sms.end needs to be called after stream to promise. I suggest converting the await to a traditional promise. Otherwise you are closing the stream without having written anything out yet. It doesn't start pulling on the stream until streamToPromise is invoked as it has nowhere to write. arrayOfSitemapItems.forEach(item => sms.write(item));
streamToPromise(sms).then(xml => console.log(xml))
sms.end(); |
I'm going to try to improve the error message for this case and the documentation around streams in general. |
Seems like in your testcase. you are closing before const smis = new SitemapItemStream(); Link: https://github.com/ekalinin/sitemap.js/blob/master/tests/sitemap-item-stream.test.ts#L108 |
Curious. I'm not sure why that worked. |
Got this error while calling:
streamToPromise(sms).then(buffer => console.log(buffer.toString()))
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be one of type Array, Buffer, or Uint8Array. Received type undefined
The text was updated successfully, but these errors were encountered: