W3cubDocs

/Astro

Invalid type returned by Astro page.

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

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:

© 2021 Fred K. Schott
Licensed under the MIT License.
https://docs.astro.build/en/reference/errors/only-response-can-be-returned/