I'm currently working on a small Form using the kit feature Actions. However, I'm facing an issue when trying to submit the form - I keep receiving a "405 POST method not allowed. No actions exist for this page" error message. My code is quite straightforward.
/form/+page.server.ts
import type { Actions } from './$types';
import {error} from '@sveltejs/kit'
export const actions: Actions = {
contact: async ({ cookies, request }) => {
console.log(request.formData);
},
} satisfies Actions;
and
/form/+page.svelte
<form method="POST" action="?/contact" class="w-full">
<input
id="name"
name="name"/>
<label for="name">name</label>
<input
id="email"
name="email"/>
<label for="email">email</label>
<input
id="phone"
name="phone"/>
<label for="name">phone</label>
</form>
I'm unsure of what I might be doing wrong or if there's something missing in my implementation.
Despite going through the documentation, I still find myself looking for some guidance or assistance.