इसे छोड़कर कंटेंट पर जाएं
This is an unmaintained snapshot of the Astro v4 docs. View the latest docs.

Value assigned to locals is not accepted.

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

LocalsNotAnObject: locals can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.

Thrown when locals is overwritten with something that is not an object

For example:

import {defineMiddleware} from "astro:middleware";
export const onRequest = defineMiddleware((context, next) => {
context.locals = 1541;
return next();
});
योगदान करें

आपके दिमाग में क्या है?

समुदाय