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

Forwarding errors from node-stream-zip #55

Closed
danielchiu opened this issue Apr 19, 2023 · 8 comments
Closed

Forwarding errors from node-stream-zip #55

danielchiu opened this issue Apr 19, 2023 · 8 comments

Comments

@danielchiu
Copy link

Hello! We're using xlstream with great success - thank you :)

Occasionally, we hit errors from inside the library, specifically Cannot read properties of undefined (reading 'pipe'). Looking at the source code, it looks like the stream is undefined.

This stream comes from node-stream-zip, and indeed in the the types it looks like the stream is optional, presumably when there is an error passed in.

We unfortunately don't have a repro, but will attempt to find one. Have you seen this happen before? I'm also curious whether it'd be possible to surface the error from node-stream-zip rather than hitting the exception on .pipe().

@jansivans
Copy link
Member

Hello!
You might be correct - if the stream parameter is optional, it appears that it will be undefined when the err is passed to the callback. However, xlstream doesn't seem to handle err, which is why you receive an inaccurate error message.
I can attempt to fix this issue based on our assumptions (for instance, by rethrowing err), but this doesn't guarantee that the error will be resolved for your specific problem.
Therefore, I would greatly appreciate it if you could provide or create an .xlsx file that I can use for reproduction purposes.

@danielchiu
Copy link
Author

Hi - thank you!

I would love to provide an .xlsx repro, but don't currently have one since they are user-provided files. We added additional tracking so we'll know better next time, and I'll let you know! Rethrowing the node-stream-zip error will likely also make the situation clearer.

@AlexTimo
Copy link
Member

Hi @danielchiu!

Were you able to gather any more details about the errors?

@danielchiu
Copy link
Author

Thanks for bumping! We forked the repo with error forwarding, and now at least have the base error:

Received error from node-stream-zip: Error: Invalid local header
    at ZipEntry.readDataHeader (/opt/render/project/src/node_modules/.pnpm/node-stream-zip@1.15.0/node_modules/node-stream-zip/node_stream_zip.js:850:19)

It's inconsistent in that the same file will not always manifest the issue, and the only online reference is tschaub/mock-fs#349 (comment). Best guess is something concurrency-related. Have you seen this before in your usage of node-stream-zip?

@AlexTimo
Copy link
Member

I don't think we do run into this one with any regularity. Would be really helpful if you could provide us a sample of your script and an Excel file that triggers this issue, even if sporadically.

@danielchiu
Copy link
Author

Not the easiest to isolate but will give it a shot!

@AlexTimo
Copy link
Member

AlexTimo commented Jun 7, 2023

Hi Daniel,

were you able to gather any additional info? Perhaps there is something that you might like to contribute to the library to make troubleshooting easier for others as well?

@danielchiu
Copy link
Author

Apologies for the delay while I was traveling - feel free to do whatever you wish with #57!

@jansivans jansivans closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
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

3 participants