Open to feedback as I'm sure this isn't the most elegant way to handle this, however it did resolve the issue I was experiencing in the linked issue.
๐ Linked issue
2613
โ Type of change
[ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
[x] ๐ Bug fix (a non-breaking change that fixes an issue)
[ ] ๐ Enhancement (improving an existing functionality like performance)
[ ] โจ New feature (a non-breaking change that adds functionality)
[ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
[ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
I would get the error reader.getReader is not a function whenever I tried to redirect from a SolidStart api route - the request body returned by nitroApp.localCall can be of type ReadableStream or XMLHttpRequestBodyInit, the latter was not being handled which was causing the error.
Just to add, my team was in the process of upgrading our regular APIs to the stream-based API for certain routes that needed to support streams, and this fix works with the regular routes as well
Open to feedback as I'm sure this isn't the most elegant way to handle this, however it did resolve the issue I was experiencing in the linked issue.
๐ Linked issue
2613
โ Type of change
๐ Description
I would get the error
reader.getReader is not a function
whenever I tried to redirect from a SolidStart api route - the request body returned by nitroApp.localCall can be of typeReadableStream
orXMLHttpRequestBodyInit
, the latter was not being handled which was causing the error.๐ Checklist