I'm trying out sveltekit form actions, and it keeps on giving 500 Internal Error with the title in the console: node.component is not a function
src/routes/login/ page.server.js
import type { Actions } from '@sveltejs/kit';
export const actions: Actions = {
default: async ({ request, cookies, url }) => {
return { success: true }
}
};
src/routes/ page.svelte
<form method="POST" action="/login">
<div >
<button type="submit">Login</button>
</div>
</form>
CodePudding user response:
You need to add a file src/routes/login/ page.svelte
since without it the form won't be able to work.