Skip to content

无法加载中间件。

MiddlewareCantBeLoaded:加载中间件时抛出了未知错误。

¥MiddlewareCantBeLoaded: An unknown error was thrown while loading your middleware.

¥What went wrong?

当中间件在尝试加载时抛出错误时,在开发模式下抛出。

¥Thrown in development mode when middleware throws an error while attempting to loading it.

例如:

¥For example:

import {defineMiddleware} from "astro:middleware";
throw new Error("Error thrown while loading the middleware.")
export const onRequest = defineMiddleware(() => {
return "string"
});
Astro 中文网 - 粤ICP备13048890号