From fd4647b530faf228547816cbf7ee997eb5ceb3b6 Mon Sep 17 00:00:00 2001 From: David Roizenman Date: Tue, 8 Mar 2022 16:21:43 -0800 Subject: [PATCH 1/2] fix: couple remnants of app.render in docs, error msg --- documentation/docs/09-adapters.md | 2 +- packages/kit/src/core/build/build_server.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/docs/09-adapters.md b/documentation/docs/09-adapters.md index d17df5ffb7a5..edec74c2f983 100644 --- a/documentation/docs/09-adapters.md +++ b/documentation/docs/09-adapters.md @@ -104,7 +104,7 @@ Within the `adapt` method, there are a number of things that an adapter should d - Imports `App` from `${builder.getServerDirectory()}/app.js` - Instantiates the app with a manifest generated with `builder.generateManifest({ relativePath })` - Listens for requests from the platform, converts them to a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) if necessary, calls the `render` function to generate a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) and responds with it - - expose any platform-specific information to SvelteKit via the `platform` option passed to `app.render` + - expose any platform-specific information to SvelteKit via the `platform` option passed to `server.respond` - Globally shims `fetch` to work on the target platform, if necessary. SvelteKit provides a `@sveltejs/kit/install-fetch` helper for platforms that can use `node-fetch` - Bundle the output to avoid needing to install dependencies on the target platform, if necessary - Put the user's static files and the generated JS/CSS in the correct location for the target platform diff --git a/packages/kit/src/core/build/build_server.js b/packages/kit/src/core/build/build_server.js index 1d9e69020520..c08c64616cb2 100644 --- a/packages/kit/src/core/build/build_server.js +++ b/packages/kit/src/core/build/build_server.js @@ -97,7 +97,7 @@ export class Server { respond(request, options = {}) { if (!(request instanceof Request)) { - throw new Error('The first argument to app.render must be a Request object. See https://github.com/sveltejs/kit/pull/3384 for details'); + throw new Error('The first argument to server.respond must be a Request object. See https://github.com/sveltejs/kit/pull/3384 for details'); } return respond(request, this.options, options); From 4bd39737e55881788223b9ee0aa063cac54ce341 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 9 Mar 2022 16:23:43 -0500 Subject: [PATCH 2/2] Create breezy-ears-fetch.md --- .changeset/breezy-ears-fetch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/breezy-ears-fetch.md diff --git a/.changeset/breezy-ears-fetch.md b/.changeset/breezy-ears-fetch.md new file mode 100644 index 000000000000..266e5c489036 --- /dev/null +++ b/.changeset/breezy-ears-fetch.md @@ -0,0 +1,5 @@ +--- +"@sveltejs/kit": patch +--- + +fix error message for invalid request object