File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
packages/kit/src/runtime/server Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/kit ' : patch
3+ ---
4+
5+ chore: error during development when using ` use:enhance ` with ` +server `
Original file line number Diff line number Diff line change 1+ import { DEV } from 'esm-env' ;
12import { ENDPOINT_METHODS , PAGE_METHODS } from '../../constants.js' ;
23import { negotiate } from '../../utils/http.js' ;
34import { Redirect } from '../control.js' ;
@@ -10,6 +11,10 @@ import { method_not_allowed } from './utils.js';
1011 * @returns {Promise<Response> }
1112 */
1213export async function render_endpoint ( event , mod , state ) {
14+ if ( DEV && event . request . headers . get ( 'x-sveltekit-action' ) === 'true' ) {
15+ throw new Error ( 'use:enhance should only be used with SvelteKit form actions' ) ;
16+ }
17+
1318 const method = /** @type {import('types').HttpMethod } */ ( event . request . method ) ;
1419
1520 let handler = mod [ method ] || mod . fallback ;
You can’t perform that action at this time.
0 commit comments