跳到內容

The middleware didn't return a Response.

本頁內容尚未翻譯。

MiddlewareNoDataOrNextCalled: Make sure your middleware returns a Response object, either directly or by returning the Response from calling the next function.

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;
});
貢獻

你有哪些想法?

社群
京ICP备15031610号-99