| title | The middleware didn't return a Response. |
|---|---|
| i18nReady | true |
| githubURL | https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts |
import DontEditWarning from '~/components/DontEditWarning.astro'
MiddlewareNoDataOrNextCalled: Make sure your middleware returns a
Responseobject, either directly or by returning theResponsefrom calling thenextfunction.
Thrown when the middleware does not return any data or call the next function.
For example:
import {defineMiddleware} from "astro:middleware";
export const onRequest = defineMiddleware((context, _) => {
// doesn't return anything or call `next`
context.locals.someData = false;
});