Skip to content

Astro 页面返回的类型无效。

路由返回 RETURNED_VALUE。Astro 文件只能返回响应。

¥Route returned a RETURNED_VALUE. Only a Response can be returned from Astro files.

¥What went wrong?

Astro 文件中只能返回 响应 的实例。

¥Only instances of Response can be returned inside Astro files.

pages/login.astro
---
return new Response(null, {
status: 404,
statusText: 'Not found'
});
// Alternatively, for redirects, Astro.redirect also returns an instance of Response
return Astro.redirect('/login');
---

也可以看看:

¥See Also:

Astro 中文网 - 粤ICP备13048890号