跳转到内容

Can't load the middleware.

MiddlewareCantBeLoaded: 加载你的中间件时发生了未知错误。

在开发模式下,当 Astro 尝试加载这个中间件时,它抛出了一个错误。

例如:

import {defineMiddleware} from "astro:middleware";
throw new Error("Error thrown while loading the middleware.")
export const onRequest = defineMiddleware(() => {
return "string"
});