Next.js site with static forms plugin
I have a Next.js site deployed on Pages and have a
functions/_middleware.ts
file with the static forms plugin configured but, none of my forms on any page seem to be getting intercepted by it. When I submit a form, it does a regular GET request and just pushes all the form data into the URL.
Any ideas on what else I can try?1 Reply
Hi!
Ensure that your _middleware.ts file is correctly configured.
Check if the file is in the correct location (usually /pages or /src/pages).
Verify that the middleware function is properly exported.
Example:
typescript
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
// Your middleware logic here
return NextResponse.next()
}