We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
adapter-node
Describe the bug
Endpoints that return an Uint8Array fail with the message
Uint8Array
The "chunk" argument must be of type string or an instance of Buffer. Received an instance of Uint8Array
when using adapter-node.
To Reproduce Use the following endpoint and try to access it on the browser using a build that runs with adapter-node:
import type { RequestHandler } from '@sveltejs/kit'; export const get: RequestHandler = async (request) => { const headers = { 'content-type': 'application/octet-stream' }; return { status: 200, headers, body: new Uint8Array([1,2,3,4,5]) }; };
Expected behavior The build should return the correct binary data in the same way as svelte-kit dev and svelte-kit preview.
svelte-kit dev
svelte-kit preview
Stacktraces No stacktraces, but the issue is caused by
kit/packages/adapter-node/src/server.js
Lines 83 to 89 in 06e1c25
Information about your SvelteKit Installation:
System: OS: Windows 10 10.0.19043 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 9.53 GB / 31.80 GB Binaries: Node: 14.17.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 91.0.4472.124 Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.67) npmPackages: @sveltejs/adapter-node: next => 1.0.0-next.32 @sveltejs/kit: next => 1.0.0-next.124 svelte: ^3.34.0 => 3.38.3
Additional context Issue #1381 mentions this error, but it's closed and its PR is already merged.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Endpoints that return an
Uint8Array
fail with the messagewhen using
adapter-node
.To Reproduce
Use the following endpoint and try to access it on the browser using a build that runs with
adapter-node
:Expected behavior
The build should return the correct binary data in the same way as
svelte-kit dev
andsvelte-kit preview
.Stacktraces
No stacktraces, but the issue is caused by
kit/packages/adapter-node/src/server.js
Lines 83 to 89 in 06e1c25
Information about your SvelteKit Installation:
Diagnostics
System:
OS: Windows 10 10.0.19043
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 9.53 GB / 31.80 GB
Binaries:
Node: 14.17.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 91.0.4472.124
Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.67)
npmPackages:
@sveltejs/adapter-node: next => 1.0.0-next.32
@sveltejs/kit: next => 1.0.0-next.124
svelte: ^3.34.0 => 3.38.3
Additional context
Issue #1381 mentions this error, but it's closed and its PR is already merged.
The text was updated successfully, but these errors were encountered: