@sveltejs/kit 2.7.0 → 2.7.1

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": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "SvelteKit is the fastest way to build Svelte apps",
5
5
  "keywords": [
6
6
  "framework",
@@ -28,7 +28,7 @@
28
28
  "mrmime": "^2.0.0",
29
29
  "sade": "^1.8.1",
30
30
  "set-cookie-parser": "^2.6.0",
31
- "sirv": "^2.0.4",
31
+ "sirv": "^3.0.0",
32
32
  "tiny-glob": "^0.2.9"
33
33
  },
34
34
  "devDependencies": {
@@ -16,6 +16,7 @@ import { respond_with_error } from './respond_with_error.js';
16
16
  import { get_option } from '../../../utils/options.js';
17
17
  import { get_data_json } from '../data/index.js';
18
18
  import { load_page_nodes } from './load_page_nodes.js';
19
+ import { DEV } from 'esm-env';
19
20
 
20
21
  /**
21
22
  * The maximum request depth permitted before assuming we're stuck in an infinite loop
@@ -99,6 +100,21 @@ export async function render_page(event, page, options, manifest, state, resolve
99
100
  // no server data to prerender. As a result, the load functions and rendering
100
101
  // only occur client-side.
101
102
  if (get_option(nodes, 'ssr') === false && !(state.prerendering && should_prerender_data)) {
103
+ // if the user makes a request through a non-enhanced form, the returned value is lost
104
+ // because there is no SSR or client-side handling of the response
105
+ if (DEV && action_result && !event.request.headers.has('x-sveltekit-action')) {
106
+ if (action_result.type === 'error') {
107
+ console.warn(
108
+ "The form action returned an error, but +error.svelte wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with `use:enhance`. See https://kit.svelte.dev/docs/form-actions#progressive-enhancement-use-enhance"
109
+ );
110
+ } else if (action_result.data) {
111
+ /// case: lost data
112
+ console.warn(
113
+ "The form action returned a value, but it isn't available in `$page.form`, because SSR is off. To handle the returned value in CSR, enhance your form with `use:enhance`. See https://kit.svelte.dev/docs/form-actions#progressive-enhancement-use-enhance"
114
+ );
115
+ }
116
+ }
117
+
102
118
  return await render_response({
103
119
  branch: [],
104
120
  fetched,
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '2.7.0';
4
+ export const VERSION = '2.7.1';