server actions not allowed in static exports
Answered
Yellowstripe scad posted this in #help-forum
Yellowstripe scadOP
Hello everyone I have a next js 14 app with app router that uses sanity for data fetching and i treid to set it up to use output: export.
But when i try to use client.fetch i get the error server actions not allowed, am i doing something wrong or is it not possible to fetch sanity data when using static export.
If it's not possible can someone explain why, since normal fetches and promise resolvings work fine. ⁉️
But when i try to use client.fetch i get the error server actions not allowed, am i doing something wrong or is it not possible to fetch sanity data when using static export.
If it's not possible can someone explain why, since normal fetches and promise resolvings work fine. ⁉️
Answered by Clown
IIRC you cant use Route Handlers in static export with anything that uses Request or a verb other than
GET.3 Replies
IIRC you cant use Route Handlers in static export with anything that uses Request or a verb other than
GET.Answer
I just checked the docs and they don't really explicitly mention anything about server actions but from what i know Server Actions are basically a
POST route handler so yeah....