Missing content type header for mutations leads to 405
Im migrating my app from Next Pages Router to App Router. I implemented the new trpc wrapper as explained here and everything seems to be working as I expected, except mutations. Mutations fail on preflight with a 405 (local development, same server).
The only difference between the "before" and "after" of the migration (As well as the only difference to queries) is that mutations are missing a content-type: "json" (See attached). Any idea how I can fix this?
Solution:Jump to solution
Ok .... so for prosterity the issue was in the server API route. it was missing a POST handler. Fixed version:
```tsx
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";...
2 Replies