Skip to content

fix: rebuild module imports after content entry deletion - #17713

Merged
matthewp merged 3 commits into
withastro:mainfrom
wakqasahmed:fix/content-modules-stale-import-17707
Aug 20, 2026
Merged

matthewp merged 3 commits into
withastro:mainfrom
wakqasahmed:fix/content-modules-stale-import-17707

Conversation

@wakqasahmed

Copy link
Copy Markdown

Fixes #17707

Changes

  • content-modules.mjs was only ever appended to via #moduleImports, so deleting or renaming a content file with deferredRender left a stale entry pointing at a non-existent file. This caused Vite to attempt to resolve the missing module (e.g. in dev, after removing an MDX/Markdown page).
  • Added #rebuildModuleImports(), mirroring the existing #rebuildAssetImports() pattern used for the asset-imports stale-entry fix (astro dev does not recover from invalid content collection image path #16097). It clears #moduleImports and rebuilds it from the current _collections state.
  • writeModuleImports() now calls #rebuildModuleImports() before writing, and delete(), clear(), and clearAll() now also trigger a debounced module-imports rewrite (previously they only rewrote asset imports).

Testing

Added two unit tests to packages/astro/test/units/content-collections/mutable-data-store.test.ts:

  • removes stale module imports when an entry is deleted
  • removes stale module imports when a collection is cleared

Ran the full mutable-data-store.test.ts suite locally (8 tests, all passing):

✔ removes stale image asset import after entry image path is updated (issue #16097)
✔ removes asset imports when an entry is deleted
✔ removes asset imports when a collection is cleared
✔ removes stale module imports when an entry is deleted
✔ removes stale module imports when a collection is cleared
✔ reproduces race condition: concurrent writeToDisk() calls lose data
✔ strips image prefixes and records their paths as out-of-band imageImports
✔ does not set imageImports when the entry has no images

Docs

No user-facing API changes; no docs needed.

@changeset-bot

changeset-bot Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5397992

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 420 packages
Name Type
astro Patch
@e2e/astro-linked-lib Patch
@e2e/actions-blog Patch
@e2e/actions-react-19 Patch
@e2e/astro-component Patch
@e2e/astro-envs Patch
@e2e/astro-island-hydration-error Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@e2e/content-collections Patch
@e2e/csp-server-islands Patch
@e2e/css Patch
@test/custom-client-directives Patch
@e2e/dev-toolbar Patch
@e2e/error-cyclic Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/hydration-race Patch
@e2e/i18n Patch
@test/nested-style-bug-e22e Patch
@e2e/preact-compat-component Patch
@e2e/preact-component Patch
@e2e/preact-lazy-component Patch
@e2e/prefetch Patch
@e2e/react-component Patch
@e2e/server-islands-key Patch
@e2e/server-islands Patch
@e2e/solid-circular Patch
@e2e/solid-component Patch
@e2e/solid-recurse Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch
@e2e/view-transitions Patch
@e2e/vue-component Patch
@performance/md Patch
@performance/mdoc Patch
@performance/mdx Patch
@test/0-css Patch
fake-astro-library Patch
@test/actions Patch
@test/alias-css-url-data-uri Patch
@test/alias-css-url Patch
@test/alias-path-alias-style Patch
@test/ts-paths-no-baseurl Patch
@test/aliases-tsconfig Patch
@test/aliases Patch
@test/api-routes Patch
@test/asset-query-params-chunks Patch
@test/asset-url-base Patch
@test/astro-pages Patch
@test/astro-assets-prefix Patch
@test/astro-assets Patch
@test/astro-basic Patch
@test/astro-check-errors Patch
@test/astro-check-no-errors Patch
@test/astro-check-watch Patch
@test/astro-children Patch
@test/astro-client-only Patch
@test/astro-component-bundling Patch
@test/astro-component-code Patch
@test/astro-css-bundling Patch
@test/astro-dev-headers Patch
@test/astro-dev-http2 Patch
@test/astro-doctype Patch
@test/astro-dynamic Patch
@test/astro-env-content-collections Patch
@test/astro-env-required-public Patch
@test/astro-env-server-fail Patch
@test/astro-env-server-secret Patch
@test/astro-env Patch
@test/astro-envs Patch
@test/astro-expr Patch
@test/astro-get-static-paths Patch
@test/astro-head Patch
@test/astro-manifest-client-script Patch
@test/astro-manifest-invalid Patch
@test/astro-manifest Patch
@test/astro-markdown-frontmatter-injection Patch
@test/astro-markdown-plugins Patch
@test/astro-markdown-remarkRehype Patch
@test/astro-markdown-skiki-default-color Patch
@test/astro-markdown-skiki-langs Patch
@test/astro-markdown-skiki-themes-custom Patch
@test/astro-markdown-skiki-themes-integrated Patch
@test/astro-markdown-skiki-wrap-false Patch
@test/astro-markdown-skiki-wrap-null Patch
@test/astro-markdown-skiki-wrap-true Patch
@test/astro-markdown-url Patch
@test/astro-markdown Patch
@test/astro-mode Patch
@test/astro-page-directory-url Patch
@test/astro-partial-html Patch
@test/astro-preview-allowed-hosts Patch
@test/astro-preview-headers Patch
@test/astro-public Patch
@test/astro-script-template-dedup Patch
@test/astro-scripts Patch
@test/astro-slots-nested Patch
@test/concurrency Patch
@test/build-readonly-file Patch
@test/cache-memory-query-include Patch
@test/cache-memory-query Patch
@test/client-address-node Patch
@test/client-only-child-styles Patch
@test/client-only-css-chunk-leak Patch
@test/code-component Patch
@test/component-library Patch
@test/config-vite-css-target-no-minify Patch
@test/config-vite-css-target Patch
@test/config-vite Patch
@test/react-container Patch
@test/content-with-spaces-in-folder-name Patch
@test/content-collection-picture-render Patch
@example/content-collection-references Patch
@test/content-collection-tla-svg Patch
@test/content-collections-base Patch
@test/content-collections-empty-dir Patch
@test/content-collections-empty-md-file Patch
@test/content-collections-image-hmr Patch
@test/content-collections-mutation Patch
@test/content-collections-number-id Patch
@test/content-collections-type-inference Patch
@test/content-collections-with-config-mjs Patch
@test/content-collections Patch
@test/content-frontmatter Patch
@test/content-intellisense Patch
@test/content-layer-loader-schema-function Patch
@test/content-layer-remark-plugins Patch
@test/content-layer Patch
@test/content-ssr-integration Patch
@test/content-static-paths-integration Patch
@test/content Patch
@test/core-image-data-url Patch
@test/core-image-deletion-ssr Patch
@test/core-image-deletion Patch
@test/core-image-errors Patch
@test/core-image-fs-config Patch
@test/core-image-remark-infersize Patch
@test/core-image-layout Patch
@test/core-image-picture-emit-file Patch
@test/core-image-remark-imgattr Patch
@test/core-image-ssg Patch
@test/core-image-ssr Patch
@test/core-image-svg-in-client Patch
@test/core-image-svg Patch
@test/core-image-unconventional-settings Patch
@test/core-image Patch
@test/csp-adapter Patch
@test/csp-fonts Patch
@test/csp Patch
@test/css-assets Patch
@test/css-dangling-references Patch
@test/css-deduplication Patch
@test/css-double-bundle Patch
@test/css-dynamic-import-dev Patch
@test/css-import-as-inline Patch
@test/css-inline-stylesheets Patch
@test/css-no-code-split Patch
@test/css-path-case Patch
@test/css-pure-chunk-query-params Patch
@test/css-server-output-dedup Patch
@test/custom-404-injected-from-dep Patch
@test/custom-404-pkg Patch
custom-fetch-error-pages Patch
@test/custom-renderer Patch
@test/data-collections-schema Patch
@test/data-collections Patch
@test/debug-component Patch
@test/dev-container Patch
@test/dev-render Patch
@test/dev-request-url Patch
@test/dynamic-endpoint-collision Patch
@test/dynamic-route-build-file Patch
@test/endpoint-routing Patch
@test/error-bad-js Patch
@test/error-build-location Patch
@test/error-non-error Patch
@test/extension-matching Patch
@test/fetch Patch
@test/fonts Patch
@test/astro-fontsource-package Patch
@test/get-static-paths-pages Patch
@test/glob-pages-css Patch
@test/head-propagation-prerender-env Patch
@test/hmr-markdown Patch
@test/hmr-middleware Patch
@test/hmr-new-page Patch
@test/hmr-slots-render Patch
@test/hoisted-imports Patch
@test/html-component Patch
@test/html-escape Patch
@test/html-page Patch
@test/html-slots Patch
@test/hydration-race Patch
@test/i18n-client-import Patch
@test/i18n-css-leak-basic Patch
@test/import-ts-with-js Patch
@test/impostor-md-file Patch
@test/incremental-build-client-only Patch
@test/incremental-build-concurrency Patch
@test/incremental-build-content Patch
@test/incremental-build-drop-key Patch
@test/incremental-build-dynamic-import Patch
@test/incremental-build-fonts Patch
@test/incremental-build-headers Patch
@test/incremental-build-images Patch
@test/incremental-build-islands Patch
@test/incremental-build-no-output Patch
@test/incremental-build-script Patch
@test/incremental-build Patch
@test/integration-add-page-extension Patch
@test/integration-server-setup Patch
@test/jsx-queue-rendering Patch
@test/large-array-solid Patch
@test/legacy-collections-backwards-compat Patch
@test/lightningcss-css-modules-content Patch
@test/lightningcss-scoped-nesting Patch
@test/live-loaders Patch
@test/markdown Patch
@test/middleware-dev Patch
@test/middleware-full-ssr Patch
@test/middleware-no-user-middlewaqre Patch
@test/middleware-tailwind Patch
@test/minification-html-default Patch
@test/minification-html-jsx Patch
@test/minification-html Patch
@test/non-ascii-path Patch
@test/non-html-pages Patch
@test/page-format Patch
@test/page-level-styles Patch
@test/parallel-components Patch
@test/partials-css-boundary Patch
@test/partials Patch
@test/passthrough-image-service Patch
@test/postcss Patch
@test/preact-compat-component Patch
@test/preact-component Patch
@test/remote-css Patch
@test/request-signal Patch
@test/reuse-injected-entrypoint Patch
@test/root-srcdir-css Patch
@test/scoped-style-strategy Patch
@test/server-entry-fake-adapter Patch
@test/server-entry Patch
@test/server-islands-hybrid Patch
@test/server-islands-ssr Patch
@test/session-false Patch
@test/session-tree-shake Patch
@test/sessions Patch
@test/slots-preact Patch
@test/slots-react Patch
@test/slots-solid Patch
@test/slots-svelte Patch
@test/slots-vue Patch
@test/solid-component Patch
@test/sourcemap Patch
@test/space-in-folder-name Patch
@test/special-chars-in-component-imports Patch
@test/ssr-assets Patch
@test/ssr-dynamic Patch
@test/ssr-partytown Patch
@test/ssr-prerender-get-static-paths Patch
@test/ssr-prerender Patch
@test/ssr-preview Patch
@test/ssr-renderers-static-vue Patch
@test/ssr-request Patch
@test/ssr-hoisted-script Patch
@test/ssr-scripts Patch
@test/static-build-code-component Patch
@test/static-build-dir Patch
@test/static-build-frameworks Patch
@test/static-build-page-url-format Patch
@test/static-build-ssr Patch
@test/static-build Patch
@test/static-redirect Patch
@test/svelte-component Patch
@test/svg-deduplication Patch
@test/tailwindcss Patch
@e2e/third-party-astro Patch
@test/url-import-suffix Patch
@test/view-transitions Patch
@test/virtual-astro-file Patch
@test/vite-virtual-modules Patch
@test/vitest Patch
@test/vue-component Patch
@test/vue-with-multi-renderer Patch
@test/alpinejs-basics Patch
@test/alpinejs-directive Patch
@test/alpinejs-plugin-script-import Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-cache Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-cache-provider Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-custom-image-service Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile-fetch-state Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-custom-image-service Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/cloudflare-incremental-images Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/astro-cloudflare-prerenderer-render-error Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch
@test/markdoc-content-collections Patch
@test/content-layer-markdoc Patch
@test/headings-custom Patch
@test/headings Patch
@test/image-assets-custom Patch
@test/image-assets Patch
@test/markdoc-propagated-assets Patch
@test/markdoc-render-with-space Patch
@test/markdoc-render-html Patch
@test/markdoc-render-null Patch
@test/markdoc-render-partials Patch
@test/markdoc-render-simple Patch
@test/markdoc-render-table-attrs Patch
@test/markdoc-render-this-context Patch
@test/markdoc-render-typographer Patch
@test/markdoc-render-with-components Patch
@test/markdoc-render-with-config Patch
@test/markdoc-render-with-extends-components Patch
@test/markdoc-render-with-indented-components Patch
@test/markdoc-render-with-transform Patch
@test/markdoc-variables Patch
@test/content-layer-rendering Patch
@test/mdx-css-head-mdx Patch
@test/image-remark-imgattr Patch
@test/mdx-astro-container-escape Patch
@test/mdx-frontmatter-injection Patch
@test/netlify-skew-protection Patch
@test/netlify-hosted-astro-project Patch
@test/nodejs-api-route Patch
@test/nodejs-badurls Patch
@test/nodejs-encoded Patch
@test/nodejs-errors Patch
@test/nodejs-headers Patch
@test/nodejs-image Patch
@test/locals Patch
@test/node-middleware Patch
@test/nodejs-prerender-404-500 Patch
@test/nodejs-prerender Patch
@test/nodejs-prerendered-error-page-fetch Patch
@test/nodejs-preview-headers Patch
@test/redirects Patch
@test/node-sessions Patch
@test/ssr-assets-middleware Patch
@test/node-static-headers Patch
@test/node-trailingslash Patch
@test/url Patch
@test/well-known-locations Patch
@test/react-component Patch
@test/sitemap-chunks Patch
@test/sitemap-dynamic Patch
@test/sitemap-i18n-fallback Patch
@test/sitemap-ssr Patch
@test/sitemap-static Patch
@test/sitemap-trailing-slash Patch
async-rendering Patch
conditional-rendering Patch
@test/empty-class Patch
svelte-prop-types Patch
@test/astro-vercel-basic Patch
@test/astro-vercel-image Patch
@test/astro-vercel-integration-assets Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands-static Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/vercel-static-headers Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project Patch
@test/vue-app-entrypoint-async Patch
@test/vue-app-entrypoint-css Patch
@test/vue-app-entrypoint-no-export-default Patch
@test/vue-app-entrypoint-relative Patch
@test/vue-app-entrypoint-src-absolute Patch
@test/vue-app-entrypoint Patch
@test/vue-basics Patch
vue-prop-types Patch
astro-benchmark Patch
@benchmark/adapter Patch
@benchmark/timer Patch

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Aug 15, 2026
@codspeed

codspeed Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 13.23%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 3 (👁 3) regressed benchmarks
✅ 18 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
👁 Simulation Build: hybrid site (static + server) 1.4 s 1.6 s -14.12%
👁 Simulation Build: full server site 1.4 s 1.6 s -14.91%
👁 Simulation Rendering: streaming [true], .md file 1.3 ms 1.4 ms -10.61%

Comparing wakqasahmed:fix/content-modules-stale-import-17707 (5397992) with main (97140b2)

Open in CodSpeed

@wakqasahmed wakqasahmed left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cold-start review (no prior context on this change).

Verdict: looks correct — non-blocking comments only. I verified the fix against the invariant it reconstructs rather than trusting the description.

Correctness of #rebuildModuleImports()

The rebuild is a faithful reconstruction. scopedStore.set() is the only thing that populates #moduleImports inside Astro:

if (deferredRender) {
  entry.deferredRender = deferredRender;
  if (filePath) {
    this.addModuleImport(filePath);
  }
}

and addModuleImport(fileName) does this.#moduleImports.set(fileName, contentModuleToId(fileName)). The new rebuild uses exactly the same predicate (deferredRender && filePath), the same map key (entry.filePath), and the same value derivation. So keys stay byte-identical to what was written before — important, because content-modules.mjs is looked up at render time by filePath, and a key-shape divergence here would have been a silent runtime break. It isn't one.

Cross-checked the only other producer, packages/astro/src/content/loaders/glob.ts:166 — store.addModuleImport(existingEntry.filePath) on the unchanged-digest fast path, where filePath is the same posixRelative(root, filePath) value. Consistent.

Meta collections (meta:*) hold plain strings, not DataEntry; typedEntry.deferredRender is undefined on those, so they're skipped. Same as #rebuildAssetImports().

Trigger points

Correct and complete for the reported bug:

  • dev-time delete/rename goes through glob.ts:405 (unlink watcher) and glob.ts:154 / glob.ts:354 — all land in MutableDataStore.delete(), which now schedules the module rewrite.
  • writeModuleImports() is called once per sync from content-layer.ts:356, immediately after writeAssetImports(), so the rebuild-before-write placement is symmetric with assets.

Performance

No regression relative to the established pattern. #writeModulesImportsDebounced() already existed and is debounced at SAVE_DEBOUNCE_MS (500ms) with clearTimeout collapsing, so the untouchedEntries.forEach(store.delete) loop in glob.ts:354 still results in one write. The added cost is one extra O(total entries) walk per debounced write, mirroring #rebuildAssetImports().

Changeset

.changeset/fix-content-modules-stale-import.md — 'astro': patch is the right package and the right bump for a bugfix with no API surface change.

Four inline notes below; none of them block.

const typedEntry = entry as DataEntry;
if (typedEntry.deferredRender && typedEntry.filePath) {
const id = contentModuleToId(typedEntry.filePath);
if (id) {

This comment was marked as spam.

This comment was marked as spam.


async writeModuleImports(filePath: PathLike) {
this.#modulesFile = filePath;
this.#rebuildModuleImports();

This comment was marked as spam.

This comment was marked as spam.

this.#modulesFile = filePath;
this.#rebuildModuleImports();

if (this.#moduleImports.size === 0) {

This comment was marked as spam.

This comment was marked as spam.

scoped.delete('page-a');
await store.writeModuleImports(modulesFilePath);
await store.waitUntilSaveComplete();

This comment was marked as spam.

This comment was marked as spam.

…ll (withastro#17707)

Prior tests called writeModuleImports() explicitly right after delete/clear,
which forced the rebuild to run synchronously regardless of whether the new
#writeModulesImportsDebounced() calls inside delete()/clear()/clearAll() were
wired correctly. Reverting those three trigger lines still passed all
existing assertions.

Rewrite the delete/clear tests to rely on waitUntilSaveComplete() alone, add
a clearAll()-specific test, and add a rename test (delete(oldId) + set(newId))
matching the issue's actual reported scenario.

Verified: reverting the three trigger lines makes the delete/clear/clearAll
tests fail; restoring them makes all pass.
@wakqasahmed

This comment was marked as spam.

@Linserin

Linserin commented Aug 17, 2026 •

Copy link
Copy Markdown

surprised to see that it had been repaired so quickly
(actually i wanted to contribute by myself in issue)

no matter how, thanks for your fixing, i had tested on my project, it worked well - cheers!

@Linserin

Copy link
Copy Markdown

maybe use string | URL instead PathLike will better...? (i guess)

The zero-size branch in writeModuleImports() fell through to the generator
below it, writing the file twice on every call where #moduleImports ends up
empty (e.g. after deleting the last deferred-render entry) -- first
'export default new Map();', then a second, differently-formatted empty-map
write. That path only became reachable once #moduleImports could shrink back
to zero, which this PR introduces. Add the missing return, matching the
pattern review comment.

Also note in the changeset that addModuleImport() callers without a backing
deferredRender entry no longer survive a write, now that #moduleImports is
fully derived state.
@matthewp

Copy link
Copy Markdown
Contributor

Thanks, I'll review this shortly.

@matthewp
matthewp merged commit d035290 into withastro:main Aug 20, 2026
29 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Aug 20, 2026
dadezzz added a commit to dadezzz/university_notes that referenced this pull request Aug 28, 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)) | [`7.2.4` → `7.2.6`](https://renovatebot.com/diffs/npm/astro/7.2.4/7.2.6) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/7.2.6?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/7.2.4/7.2.6?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/273) for more information.

---

### Release Notes

<details>
<summary>withastro/astro (astro)</summary>

### [`v7.2.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#726)

[Compare Source](https://github.com/withastro/astro/compare/[email protected]@7.2.6)

##### Patch Changes

- [#&#8203;17812](withastro/astro#17812) [`29af6da`](withastro/astro@29af6da) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a bug where `new FetchState(request)` could fail in development when server dependencies were optimized

### [`v7.2.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#725)

[Compare Source](https://github.com/withastro/astro/compare/[email protected]@7.2.5)

##### Patch Changes

- [#&#8203;17758](withastro/astro#17758) [`5f419e2`](withastro/astro@5f419e2) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes a bug where `experimental_getFontFileURL()` rejected valid font URLs when using the Cloudflare adapter

- [#&#8203;17416](withastro/astro#17416) [`493796b`](withastro/astro@493796b) Thanks [@&#8203;iseraph-dev](https://github.com/iseraph-dev)! - Skips no-op pathname writes when normalizing SSR request URLs

- [#&#8203;17712](withastro/astro#17712) [`bd374b7`](withastro/astro@bd374b7) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Updates deprecation messages target from Astro 7 to 8

- [#&#8203;17719](withastro/astro#17719) [`dac1768`](withastro/astro@dac1768) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes session ID validation to reject non-UUID cookie values before using them as storage keys

- [#&#8203;17770](withastro/astro#17770) [`84eb7e7`](withastro/astro@84eb7e7) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes `--mode`, `--site`, `--base`, `--out-dir`, `--verbose`, `--silent`, and `--open` flags being silently dropped when using `astro dev --background` or `astro preview --background`

- [#&#8203;17713](withastro/astro#17713) [`d035290`](withastro/astro@d035290) Thanks [@&#8203;wakqasahmed](https://github.com/wakqasahmed)! - Fixes `content-modules.mjs` not removing entries for deleted or renamed content files, which could cause Vite to attempt to resolve non-existent modules

  As part of this fix, `#moduleImports` is now fully rebuilt from `deferredRender` entries before every write, so a module import added only through the public `addModuleImport()` API without a corresponding `deferredRender` entry in the store will no longer be preserved across writes.

- [#&#8203;17743](withastro/astro#17743) [`adc750f`](withastro/astro@adc750f) Thanks [@&#8203;contactjawad](https://github.com/contactjawad)! - Fixes `Astro.preferredLocale` and `Astro.preferredLocaleList` ignoring `Accept-Language` quality values when they are absent or `0`. An entry without an explicit `q=` now correctly counts as quality `1.0` (per RFC 7231) and an entry with `q=0` is treated as not acceptable, so the highest-quality locale is selected regardless of header order.

- [#&#8203;17757](withastro/astro#17757) [`660991c`](withastro/astro@660991c) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes build errors showing wrong file location, missing line:col, and misleading hints when a plugin error (e.g. from MDX) is wrapped by Vite's build error

- [#&#8203;17783](withastro/astro#17783) [`60b14ff`](withastro/astro@60b14ff) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a type error when passing an image from a content collection `image()` schema to a component or `<Image />`. The schema returned by `image()` was missing the `apng` format, so it no longer matched the type of an imported image.

- [#&#8203;17664](withastro/astro#17664) [`d483125`](withastro/astro@d483125) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes an issue where Astro CSP support didn't correctly handle cases `"unsafe-inline"` resource. Now when `"unsafe-inline"`, Astro won't emit hashes for the directive specified.

- [#&#8203;17810](withastro/astro#17810) [`0fc5f65`](withastro/astro@0fc5f65) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a regression in the content collections that could cause images to not be resolved

- [#&#8203;17781](withastro/astro#17781) [`aa33b44`](withastro/astro@aa33b44) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `memoryCache()` storing responses that set cookies through `Astro.cookies` or `Astro.session`

- [#&#8203;17787](withastro/astro#17787) [`6661fbe`](withastro/astro@6661fbe) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes `server:defer` crashing the dev server with "undefined is not a function" when a deferred component imports from `astro:i18n`

- [#&#8203;17750](withastro/astro#17750) [`dd0e3ac`](withastro/astro@dd0e3ac) Thanks [@&#8203;dobrodob](https://github.com/dobrodob)! - Fixes a regression where `transition:persist` stopped working for `<audio>` and `<video>` elements.

- [#&#8203;17774](withastro/astro#17774) [`fe1d16d`](withastro/astro@fe1d16d) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Adds support for importing `.apng` files as image metadata for use with standard `<img>` elements. Astro's image components reject APNG files to avoid removing their animation

- [#&#8203;17799](withastro/astro#17799) [`8797754`](withastro/astro@8797754) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes i18n `fallbackType: "rewrite"` returning 500 instead of 404 when the fallback locale also has no matching static path for a prerendered dynamic route

- [#&#8203;17741](withastro/astro#17741) [`99d3d3d`](withastro/astro@99d3d3d) Thanks [@&#8203;ericswpark](https://github.com/ericswpark)! - Bumps the Astro compiler to the latest version. [Changelog](https://github.com/withastro/compiler-rs/releases/tag/%40astrojs%2Fcompiler-rs%400.4.0).

- [#&#8203;17782](withastro/astro#17782) [`3578d45`](withastro/astro@3578d45) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Improves the performance of the Astro CLI in local by enabling Node's module compilation cache.

- [#&#8203;17705](withastro/astro#17705) [`2043e4f`](withastro/astro@2043e4f) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes incremental builds serving cached HTML that references stale CSS filenames after a stylesheet-only edit

- [#&#8203;17754](withastro/astro#17754) [`3d50dfd`](withastro/astro@3d50dfd) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes the dev server refusing to start in Docker containers after a restart due to PID reuse in the lock file check

- [#&#8203;17769](withastro/astro#17769) [`bbda94d`](withastro/astro@bbda94d) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes a build failure when defining `vite.environments.ssr` in the Astro config. User-provided environment config for `ssr`, `prerender`, or `client` is now properly deep-merged with Astro's internal environment settings instead of silently breaking the server entry naming.

- [#&#8203;17776](withastro/astro#17776) [`0874da8`](withastro/astro@0874da8) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Fixes the `glob()` content loader failing to load files with colons in their names (e.g., `Guide: Architecture.md`)

- Updated dependencies \[[`0762a83`](withastro/astro@0762a83), [`0c99615`](withastro/astro@0c99615)]:
  - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.8

</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 CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40OC4xIiwidXBkYXRlZEluVmVyIjoiNDQuNDguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Davide Zarantonello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

the content-modules.mjs unable to remove old item after an item is deleted

3 participants