(some of this is irrelevant as this issue is specific to Netlify)
Astro v4.9.3
Node v20.11.1
System macOS (arm64)
Package Manager unknown
Output hybrid
Adapter @astrojs/netlify
Integrations @astrojs/react
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!)
commitdeploymentoutput: "server", 1 prerendered page + 1 SSR page
Actions work on both pages
commitdeploymentoutput: "hybrid", 1 prerendered page + 1 SSR page
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.
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