无法加载中间件。
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"});