Astro Actions return a 404 on Netlify when all pages are prerendered #274
Labels
- P4: important
Violate documented behavior or significantly improves performance (priority)
pkg: netlify
Astro Info
Describe the Bug
👋🏼 Hey Astro friends. In trying to validate that experimental Astro Actions work well on Netlify, we found this issue. (Otherwise, it seems to work great!)
output: "server"
, 1 prerendered page + 1 SSR pageoutput: "hybrid"
, 1 prerendered page + 1 SSR pageoutput: "server"
, 2 prerendered pagesoutput: "hybrid"
, 2 prerendered pagesYou can also reproduce this locally with
netlify serve
(notnetlify dev
).I can see the
POST /_actions/sayHello
is responding with a 404.I can see the SSR function is being invoked, but not the Action handler.
With some
console.log
sprinkling locally, I can see that 404 is coming from here (as opposed to line 24).Here's the
routeData
returned byapp.match
:Any ideas on where to start here? Is there any intentional special behavior in Astro when
output !== 'static'
but all pages are opted in to prerendering? Happy to help but I could use some pointers. Thanks!What's the expected result?
On all four branches linked above, clicking the button should print "hello ON the server" in the Netlify Function logs, print "hello FROM the server" in the browser console, and render "hello FROM the server" on the page.
Link to Minimal Reproducible Example
https://github.com/serhalp/astro-actions-netlify-demo/branches
Participation
The text was updated successfully, but these errors were encountered: