0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/cool-mangos-shop.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
512 B
Markdown
Raw Normal View History

---
'astro': major
---
The `locals` object can no longer be overridden
Middleware, API endpoints, and pages can no longer override the `locals` object in its entirety. You can still append values onto the object, but you can not replace the entire object and delete its existing values.
If you were previously overwriting like so:
```js
ctx.locals = {
one: 1,
two: 2
}
```
This can be changed to an assignment on the existing object instead:
```js
Object.assign(ctx.locals, {
one: 1,
two: 2
})
```