@sveltejs/kit 1.0.0-next.413 → 1.0.0-next.414

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.413",
3
+ "version": "1.0.0-next.414",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -250,7 +250,8 @@ export async function respond(request, options, state) {
250
250
  try {
251
251
  if (error) return;
252
252
 
253
- const node = n ? await options.manifest._.nodes[n]() : undefined;
253
+ // == because it could be undefined (in dev) or null (in build, because of JSON.stringify)
254
+ const node = n == undefined ? n : await options.manifest._.nodes[n]();
254
255
  return {
255
256
  // TODO return `uses`, so we can reuse server data effectively
256
257
  data: await load_server_data({
@@ -260,7 +261,11 @@ export async function respond(request, options, state) {
260
261
  /** @type {import('types').JSONObject} */
261
262
  const data = {};
262
263
  for (let j = 0; j < i; j += 1) {
263
- Object.assign(data, await promises[j]);
264
+ const parent = await promises[j];
265
+ if (!parent || parent instanceof HttpError || 'error' in parent) {
266
+ return data;
267
+ }
268
+ Object.assign(data, parent.data);
264
269
  }
265
270
  return data;
266
271
  }