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 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);