跳转到内容
This is an unmaintained snapshot of the Astro v4 docs. View the latest docs.

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"
});
贡献

你有什么想法?

社区