تخطَّ إلى المحتوى

Astro.locals is not serializable

هذا المحتوى غير متوفر بلغتك بعد.

LocalsNotSerializable: The information stored in Astro.locals for the path “HREF” is not serializable. Make sure you store only serializable data. (E03034)

Thrown in development mode when a user attempts to store something that is not serializable in locals.

For example:

import {defineMiddleware} from "astro/middleware";
export const onRequest = defineMiddleware((context, next) => {
context.locals = {
foo() {
alert("Hello world!")
}
};
return next();
});
ساهم المجتمع Sponsor