fix(astro): fix broken Map and Set in content collections#16701
Merged
matthewp merged 1 commit intoMay 14, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 4927438 The changes in this PR will be included in the next version bump. This PR includes changesets to release 421 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c238a6c to
fdec36f
Compare
Contributor
Author
|
It was not clear if
I've gone with the |
Map and Set in content collections (#16682)Map and Set in content collections
…tro#16682) The `updateImageReferencesInData` function uses `Traverse.map` which uses a custom cloning algorithm and as such does not copy correctly instances of native objects such as `Map` and `Set` rendering them unusable. Instead `Travserse.forEach` can be used after cloning the data object beforehand with the native `structuredClone` function. Closes withastro#16682
fdec36f to
4927438
Compare
matthewp
approved these changes
May 14, 2026
Merged
dadezzz
pushed a commit
to dadezzz/university_notes
that referenced
this pull request
May 22, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`6.3.3` → `6.3.5`](https://renovatebot.com/diffs/npm/astro/6.3.3/6.3.5) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v6.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#635) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.4...astro@6.3.5) ##### Patch Changes - [#​16771](withastro/astro#16771) [`07c8805`](withastro/astro@07c8805) Thanks [@​ematipico](https://github.com/ematipico)! - Fixes `position` prop on `<Image>` and `<Picture>` components breaking Content Security Policy (CSP). - [#​16593](withastro/astro#16593) [`50924ce`](withastro/astro@50924ce) Thanks [@​yanthomasdev](https://github.com/yanthomasdev)! - Improves error messages with more consistent and correct writing. - [#​16757](withastro/astro#16757) [`5d661cd`](withastro/astro@5d661cd) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes dev server serving stale content when SSR-only modules change (e.g. `.astro` files outside the project root in a monorepo, or dynamically imported components). Previously, the `astro:hmr-reload` plugin returned an empty array after detecting SSR-only module changes, which prevented Vite's `updateModules` from propagating the invalidation to the SSR module runner. The runner's evaluated module cache stayed stale, so subsequent requests continued returning old content. Now the plugin returns the SSR-only modules so Vite can process them through `updateModules`, which properly invalidates the module runner's cache and ensures fresh content on the next request. ### [`v6.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#634) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.3...astro@6.3.4) ##### Patch Changes - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `fetchFile` option to `experimental.advancedRouting` to customize or disable the entrypoint file ```js export default defineConfig({ experimental: { advancedRouting: { fetchFile: 'fetch.ts', }, }, }); ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Fixes Hono `cache()` middleware to follow the standard wrapper pattern - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `App.Providers` interface for typing custom context providers on `Astro` and `ctx` ```ts declare namespace App { interface Providers { oauth: import('./lib/oauth').OAuthSession; } } ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `FetchState.response` property, set automatically after `pages()` or `middleware()` completes ```ts const response = await middleware(state, (s) => pages(s)); console.log(state.response === response); // true ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `Fetchable` type export for typing the advanced routing entrypoint ```ts import type { Fetchable } from 'astro'; export default { async fetch(request) { return new Response('ok'); }, } satisfies Fetchable; ``` - [#​16572](withastro/astro#16572) [`4a5a077`](withastro/astro@4a5a077) Thanks [@​DORI2001](https://github.com/DORI2001)! - Suppresses `[WARN] Vite warning: unused imports from "@​astrojs/internal-helpers/remote"` during prerender builds. The package is now bundled alongside `astro` in the prerender environment, matching how it is handled in the SSR environment. - [#​16756](withastro/astro#16756) [`b6ee23d`](withastro/astro@b6ee23d) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes styles from Markdoc/MDX custom components not being extracted to `<head>` in the dev server when using the Cloudflare adapter with `prerenderEnvironment: 'node'` and rendering content through a wrapper component. - [#​16747](withastro/astro#16747) [`904d19a`](withastro/astro@904d19a) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes Astro action requests failing in `astro dev` when using the Cloudflare adapter with `prerenderEnvironment: 'node'` alongside a prerendered catch-all route such as `[...page].astro`. Actions and other SSR POST endpoints now continue to work in dev instead of returning an HTTP 500 error. - [#​16701](withastro/astro#16701) [`3495ce4`](withastro/astro@3495ce4) Thanks [@​demaisj](https://github.com/demaisj)! - Fix `Map` and `Set` instances saved in a content collection being broken when retrieving entries. - [#​16614](withastro/astro#16614) [`fca1c32`](withastro/astro@fca1c32) Thanks [@​Eptagone](https://github.com/Eptagone)! - Fixes `entry.data` type inference when a live collection is configured without a schema. - [#​16661](withastro/astro#16661) [`03b8f7f`](withastro/astro@03b8f7f) Thanks [@​ocavue](https://github.com/ocavue)! - Updates `typescript` to v6. No changes are needed from users. - [#​16681](withastro/astro#16681) [`c22770a`](withastro/astro@c22770a) Thanks [@​dotnetCarpenter](https://github.com/dotnetCarpenter)! - Fixes an issue where SVG images with `width="0"` or `height="0"` incorrectly threw a `NoImageMetadata` error instead of being treated as valid dimensions. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE4Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
updateImageReferencesInDatafunction usesTraverse.mapwhich uses a custom cloning algorithm and as such does not copy correctly instances of native objects such asMapandSetrendering them unusable.Instead
Travserse.forEachcan be used after cloning the data object beforehand with the nativestructuredClonefunction.Closes #16682
Changes
Travserse.forEachinstead ofTraverse.mapinupdateImageReferencesInDataTesting
Docs