Skip to content

Instantly share code, notes, and snippets.

@splatte
Created May 29, 2021 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splatte/8d57ba18d5f0643119e242beb424a3c3 to your computer and use it in GitHub Desktop.
Save splatte/8d57ba18d5f0643119e242beb424a3c3 to your computer and use it in GitHub Desktop.
patch for adapter-netlify/files/entry.js
diff --git a/node_modules/@sveltejs/adapter-netlify/files/entry.js b/node_modules/@sveltejs/adapter-netlify/files/entry.js
index c230c41..1aa9fae 100644
--- a/node_modules/@sveltejs/adapter-netlify/files/entry.js
+++ b/node_modules/@sveltejs/adapter-netlify/files/entry.js
@@ -3,8 +3,9 @@ import '@sveltejs/kit/install-fetch'; // eslint-disable-line import/no-unresolve
// TODO hardcoding the relative location makes this brittle
import { render } from '../output/server/app.js'; // eslint-disable-line import/no-unresolved
-export async function handler(event) {
+export async function handler(event, context) {
const { path, httpMethod, headers, rawQuery, body, isBase64Encoded } = event;
+ const { clientContext } = context
const query = new URLSearchParams(rawQuery);
@@ -20,7 +21,8 @@ export async function handler(event) {
headers,
path,
query,
- rawBody
+ rawBody,
+ netlifyContext: clientContext
});
if (rendered) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment