withastro/astro

Don’t work middleware in `astro:server:setup` hook when deploying Netlify.

sgalcheung opened this issue · 1 comments

Astro Info

"astro": "^5.0.0-beta

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I wrote a custom loader for Squidex, which you can read here:
https://github.com/sgalcheung/starlight-squidex/blob/5dd82aa16ac7c542fdc1805567b8ab0f51ce56c3/packages/desquidex/src/integrations.ts#L12

Initially, I asked Netlify for help, but they told me the problem was that this new API(refreshContent) didn't work well in the Production environment, for now, is this an alpha feature? and could we use it in production?

related:
#11903
https://answers.netlify.com/t/netlify-dont-work-for-my-astro-middleware-endpoint/129673/3

What's the expected result?

Handle this middleware in a production environment.

Link to Minimal Reproducible Example

http://undefined

Participation

  • I am willing to submit a pull request for this issue.

astro:server:setup is a dev-server hook, and so is refreshContent. You're trying to use it in production, which isn't supported.