-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[fix] handle binary data when prerendering #5497
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
Conversation
this is to fix issue mentioned [here](sveltejs#5088) body was always converted using `response.text()` which was always decoded with UTF-8 which then is breaking buffers
🦋 Changeset detectedLatest commit: 035a2ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
lint fix
lint fix
Rich-Harris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
as mentioned inline, I have some concerns about using Buffer.from here. i also think we need some tests before we can merge this
From myself, I can only say that your fix works fine on the project I am working on. It was a mix of |
|
@Rich-Harris I wonder if you can assist me with writing the test. I am not really familiar with repo structure, I've started writing route for the image kit/packages/kit/test/prerendering/basics/src/ |
|
Do you have an |
Yes that was it, I've had wrong path to image. I've pushed tests, not sure if it's sufficient but it's testing the problem I was facing. |
|
thank you! |
fixes #5088
body was always converted using
response.text()which was always decoded with UTF-8 which then is breaking buffersI understand that this only solved problem with images, this is just to illustrate the issue, and maybe someone can come up with better solution
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0