Skip to content

fix(assets): resolve Picture TDZ error when combined with content render()#16171

Merged
alexanderniebuhr merged 8 commits intowithastro:mainfrom
Desel72:fix/issue-16036
Apr 8, 2026
Merged

fix(assets): resolve Picture TDZ error when combined with content render()#16171
alexanderniebuhr merged 8 commits intowithastro:mainfrom
Desel72:fix/issue-16036

Conversation

@Desel72
Copy link
Copy Markdown
Contributor

@Desel72 Desel72 commented Mar 31, 2026

Introduce an internal virtual module (virtual:astro-get-image) that exports only getImage and imageConfig without any Astro component references. The content runtime now imports from this narrower module instead of astro:assets, breaking the circular initialization dependency that caused a TDZ ReferenceError when prerendered pages using <Picture> were bundled in the same chunk as content collection render() calls.

Closes #16036

Changes

  • Added a new internal virtual module virtual:astro-get-image in packages/astro/src/assets/consts.ts that exports only getImage and imageConfig — no Image, Picture, or Font component references.
  • Extended the astro:assets Vite plugin in packages/astro/src/assets/vite-plugin-assets.ts to resolve and load the new virtual module.
  • Changed packages/astro/src/content/runtime.ts to import getImage from virtual:astro-get-image instead of astro:assets, avoiding the TDZ caused by Rollup eagerly referencing $$Picture in the namespace object before its declaration is initialized.
  • Uses virtual: prefix (like existing virtual:image-service) rather than astro: prefix to keep this as an internal module and avoid exposing new public API surface.

Testing

Added a regression test (content-collection-picture-render.test.js) with a fixture that reproduces the exact scenario:

  • A prerendered page using <Picture> from astro:assets
  • A content collection page using getStaticPaths() + render(entry) with images in markdown body

Without the fix, astro build fails with:
ReferenceError: Cannot access '$$Picture' before initialization

With the fix, the build succeeds and all 4 test assertions pass. Existing related test suites also pass with zero regressions:

  • content-collection-tla-svg.test.js (3/3)
  • content-collections-render.test.js (13/13)
  • core-image-picture-emit-file.test.js (6/6)
  • units/content-collections/image-references.test.js (9/9)

Docs

No docs changes needed. This is a bug fix for an internal module resolution issue — no user-facing API changes.

…der (withastro#16036)

Introduce an internal virtual module (virtual:astro-get-image) that exports
only getImage and imageConfig without any Astro component references. The
content runtime now imports from this narrower module instead of astro:assets,
breaking the circular initialization dependency that caused a TDZ
ReferenceError when prerendered pages using <Picture> were bundled in the
same chunk as content collection render() calls.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 38866ae

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

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 Mar 31, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 31, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing Desel72:fix/issue-16036 (38866ae) with main (c2a52d6)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (44fd3b8) during the generation of this report, so c2a52d6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Desel72 added 2 commits April 1, 2026 05:23
Use colon separator (virtual:astro:*) instead of hyphen so the module
matches existing optimizeDeps.exclude patterns in both Astro core and
the Cloudflare adapter. The hyphenated name was not excluded from
Vite's dependency optimizer, causing esbuild to fail resolving it.
@Desel72
Copy link
Copy Markdown
Contributor Author

Desel72 commented Apr 1, 2026

Hi @matthewp I think this is not related with my change. If you have some free time, please check this PR.

@alexanderniebuhr
Copy link
Copy Markdown
Member

@Desel72 thank you for your PR. Will get this reviewed.

Comment thread packages/astro/src/content/runtime.ts Outdated
Comment on lines +457 to +459
// @ts-expect-error Internal virtual module that exports only getImage (no component
// references like Image/Picture) to avoid TDZ errors during prerender bundling (#16036).
const { getImage } = await import('virtual:astro:get-image');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We must add this module to dev-only.d.ts, so that we don't need the ts directive

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Desel72 can you address this comment please?

@Desel72
Copy link
Copy Markdown
Contributor Author

Desel72 commented Apr 1, 2026

Hi @alexanderniebuhr Can this be merged?

@matthewp
Copy link
Copy Markdown
Contributor

matthewp commented Apr 1, 2026

@Desel72 you need to address Ema's feedback: #16171 (comment)

Copy link
Copy Markdown
Contributor

@travisbreaks travisbreaks left a comment

Choose a reason for hiding this comment

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

Circular dependency causing TDZ errors is a nasty class of bug. The virtual module approach is a reasonable solution. A few things:

  1. Virtual module boundary durability: The fix introduces `virtual:astro:get-image` to break the cycle. Future imports could re-introduce it if someone imports from `assets/consts.ts` in a path that also touches `content/runtime.ts`. A comment in the virtual module entry point warning about this would help prevent regression.

  2. The @ts-expect-error question: ematipico's feedback about adding proper TS definitions is the right call. Virtual modules should have type declarations (`declare module "virtual:astro:get-image"`) so the `@ts-expect-error` isn't needed. This is a pattern Astro already uses for other virtual modules.

  3. Test coverage: Does the test reproduce the exact bundling condition (Picture + content render() in the same chunk)? TDZ errors are sensitive to chunk splitting heuristics, so the test should ideally force co-location rather than relying on the current bundler behavior.

Good fix for a tricky problem. The TS definitions point from ematipico would make this merge-ready.

uni added 2 commits April 2, 2026 16:14
…t-error

Add type declaration for the virtual:astro:get-image module so TypeScript
recognizes the import without needing a @ts-expect-error directive.
@Desel72
Copy link
Copy Markdown
Contributor Author

Desel72 commented Apr 2, 2026

Hi @matthewp @ematipico @alexanderniebuhr I've done. Please check.

@alexanderniebuhr alexanderniebuhr added the pr preview Apply this label to a PR to generate a preview release label Apr 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 2, 2026

npm i https://pkg.pr.new/astro@16171

commit: 8f2d9e5

@Desel72
Copy link
Copy Markdown
Contributor Author

Desel72 commented Apr 2, 2026

Hi @alexanderniebuhr Thanks. I am going to move to #16035. I've created PR: #16194. Please review asap.

@alexanderniebuhr
Copy link
Copy Markdown
Member

Tested the preview in a real-life project and it works.

@matthewp
Copy link
Copy Markdown
Contributor

matthewp commented Apr 2, 2026

@ematipico this is ready for another look when you have the chance

Comment thread .changeset/fix-picture-tdz-content-render.md Outdated
@alexanderniebuhr alexanderniebuhr merged commit 5bcd03c into withastro:main Apr 8, 2026
27 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Apr 8, 2026
dadezzz pushed a commit to dadezzz/ice-notes that referenced this pull request Apr 13, 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.1.4` → `6.1.5`](https://renovatebot.com/diffs/npm/astro/6.1.4/6.1.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/6.1.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/6.1.4/6.1.5?slim=true) |

---

### Release Notes

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

### [`v6.1.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#615)

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

##### Patch Changes

- [#&#8203;16171](withastro/astro#16171) [`5bcd03c`](withastro/astro@5bcd03c) Thanks [@&#8203;Desel72](https://github.com/Desel72)! - Fixes a build error that occurred when a pre-rendered page used the `<Picture>` component and another page called `render()` on content collection entries.

- [#&#8203;16239](withastro/astro#16239) [`7c65c04`](withastro/astro@7c65c04) Thanks [@&#8203;dataCenter430](https://github.com/dataCenter430)! - Fixes sync content inside `<Fragment>` not streaming to the browser until all async sibling expressions have resolved.

- [#&#8203;16242](withastro/astro#16242) [`686c312`](withastro/astro@686c312) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Revives UnoCSS in dev mode when used with the client router.

  This change partly reverts [#&#8203;16089](withastro/astro#16089), which in hindsight turned out to be too general. Instead of automatically persisting all style sheets, we now do this only for styles from Vue components.

- [#&#8203;16192](withastro/astro#16192) [`79d86b8`](withastro/astro@79d86b8) Thanks [@&#8203;alexanderniebuhr](https://github.com/alexanderniebuhr)! - Uses today’s date for Cloudflare `compatibility_date` in `astro add cloudflare`

  When creating new projects, `astro add cloudflare` now sets `compatibility_date` to the current date. Previously, this date was resolved from locally installed packages, which could be unreliable in some package manager environments. Using today’s date is simpler and more reliable across environments, and is supported by [`workerd`](cloudflare/workers-sdk#13051).

- [#&#8203;16259](withastro/astro#16259) [`34df955`](withastro/astro@34df955) Thanks [@&#8203;gameroman](https://github.com/gameroman)! - Removed `dlv` dependency

</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 [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDQuOCIsInVwZGF0ZWRJblZlciI6IjQzLjEwNC44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
ematipico added a commit that referenced this pull request Apr 21, 2026
* fix(cloudflare): exclude starlight from SSR dep optimization (#16151)

* [ci] release (#16152)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* refactor(mdx): more unit tests, less integrations (#16158)

* fix: stop CSS traversal at page boundaries (#16116)

* [ci] format

* fix(content): clear stale asset imports on content collection entry update (#16124)

* fix(content): clear stale asset imports on content collection entry update

* fix lint errors

* fix(core): append assetQueryParams to inter-chunk JS imports (#15964) (#16110)

* fix(core): append assetQueryParams to inter-chunk JS imports (#15964)

* Add changeset for inter-chunk skew protection fix

* [ci] format

* chore: move unit tests to ts (#16157)

* [ci] format

* fix(vercel): edge middleware next() drops HTTP method and body (#16170)

* fix(vercel): edge middleware next() drops HTTP method and body

* fix: conditional and format-sensitive

* test: don't use tmp fixtures (#16177)

* fix(preact): pre-optimize @preact/signals to prevent dev reload flakiness (#16180)

* Preserve head metadata in Cloudflare dev rendering (#16161)

* Update dev head metadata for non-runnable pipeline

* Refine non-runnable component metadata loading

* Load component metadata in non-runnable dev

* Remove unused export for virtual component metadata constant

* Add docs for virtual component metadata module

* fix(cloudflare): ensure HMR works when `prerenderEnvironment` is set to 'node' (#16162)

Co-authored-by: Matthew Phillips <[email protected]>

* Include injected routes when determining whether renderers are needed in SSR builds (#16178)

* fix(astro): Fix `isHTMLString` check failing in multi-realm environments (#16142)

* fix(container): don't escape slot HTML in renderToString during build

* performance issue

* oops

* apply Erika's suggestion

* use `isHTMLString` within `markHTMLString`

* simplify test fixtures

* format

* remove the no longer used `Symbol.toStringTag` from `HTMLString`

* rename to `htmlStringSymbol`

* update changeset

* Apply suggestion from @ematipico

---------

Co-authored-by: Emanuele Stoppa <[email protected]>

* fix(underscore-redirects): respect trailingSlash config in redirects (#16034)

Co-authored-by: astrobot-houston <[email protected]>

* [ci] format

* [ci] release (#16159)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix periods in URLs with trailing slashes causing 404s in dev server (#16154)

* Fix periods in URLs with trailing slashes causing 404s in dev server (#16140)

Pages with dots in their filenames (e.g. `hello.world.astro`) were incorrectly
treated as file-extension paths, forcing `trailingSlash: 'never'` regardless of
user config. Only endpoints with file extensions should force this behavior.

* ci: retry flaky e2e tests

* ci: retry flaky e2e tests

---------

Co-authored-by: Matthew Phillips <[email protected]>

* docs(language-tools): mention js/ts settings namespace in vscode (#16167)

* docs(language-tools): mention js/ts settings namespace in vscode

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Matthew Phillips <[email protected]>
Co-authored-by: Copilot <[email protected]>

* fix(e2e): remove bogus Node.js import breaking actions-blog tests (#16183)

A spurious import of createLoggerFromFlags from cli/flags.ts was added
to the client-side PostComment.tsx component via a sync commit, breaking
hydration and causing Comment and Logout tests to fail.

* test: increase testing coverage (#16189)

* [ci] format

* Preserve Cloudflare miniflare instance across dev server config restarts (#16059)

* fix: preserve viteServer.restart wrapper chain for Cloudflare adapter

* add changeset

* fix: use Vite in-place restart for config changes to preserve Cloudflare miniflare instance

* use vite.resolveConfig to get a proper ResolvedConfig instead of patching inlineConfig

* fix watcher listener accumulation, null-check hot.send, move restartInFlight to finally, add tests

* fix port drift on restart by passing current httpServer port to createVite

* remove non-actionable CSP dev warning

* merge main, fix restart tests to use static fixture dir

* fix(astro): remove unused re-exports causing Vite build warning (#16197)

* fix(astro): remove unused re-exports causing Vite build warning (#16188)

* chore: add changeset

---------

Co-authored-by: astrobot-houston <[email protected]>

* Fix trailingSlash for extensionless endpoints in static builds (#16193)

* Unblock smoke tests: exclude [email protected] from minimumReleaseAge (#16211)

* Exclude [email protected] from minimumReleaseAge

* Exclude @types/[email protected] from minimumReleaseAge

* feat: erasableSyntaxOnly (#15719)

* fix: react 19 ssr aito injection preload link (#16224)

* feat: integration test of react 19 auto injection preload link

* fix: when created preload in link, remove it and fix it for tag can be read

* feat: changeset file

* fix: pnpm-lock file

* fix: regexp for passing eslint

* [ci] format

* [ci] release (#16182)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(cloudflare): exclude queue consumers from prerender worker (#16225)

* fix(cloudflare): exclude queue consumers from prerender worker config

The prerender worker's config callback was spreading the entire
entryWorkerConfig, including queues.consumers. When Miniflare sees
two workers both registered as consumers of the same queue, it rejects
with ERR_MULTIPLE_CONSUMERS. The prerender worker only renders static
HTML and has no need for queue consumer registrations.

This fix destructures queues from the entry worker config and only
preserves queue producers (bindings) in the prerender worker config.

Closes #16199

Co-Authored-By: Tadao <[email protected]>

* chore: update pnpm lockfile

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Tadao <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: port tests to ts (#16243)

* fix: stream Fragment sync siblings before async children resolve (#16239)

* [ci] format

* Port 8 unit test files from JavaScript to TypeScript (#16249)

Part of the test-to-TypeScript migration (#16241).

Ported files:
- app/dev-url-construction.test
- app/headers.test
- app/url-attribute-xss.test
- assets/image-layout.test
- render/escape.test
- render/hydration.test
- routing/origin-pathname.test
- routing/routing-helpers.test

Removed @ts-check directives (redundant in .ts files), converted
JSDoc type annotations to native TypeScript where needed, and added
minimal type assertions for test mocks. typecheck:tests and both
test:unit:ts / test:unit:js pass.

* chore: adapt code to upstream deprecation (#16192)

* chore: adapt code to upstream deprecation

Signed-off-by: Alexander Niebuhr <[email protected]>

* fix remove ununsed import

Signed-off-by: Alexander Niebuhr <[email protected]>

* Apply suggestion from @alexanderniebuhr

* Apply suggestion from @alexanderniebuhr

* Apply suggestion from @alexanderniebuhr

* Apply suggestion from @alexanderniebuhr

---------

Signed-off-by: Alexander Niebuhr <[email protected]>

* refactor: migrate blog template to use new astro font loading api (#16128)

Co-authored-by: Florian Lefebvre <[email protected]>

* [ci] format

* fix(assets): resolve Picture TDZ error when combined with content render() (#16171)

* fix(assets): resolve Picture TDZ error when combined with content render (#16036)

Introduce an internal virtual module (virtual:astro-get-image) that exports
only getImage and imageConfig without any Astro component references. The
content runtime now imports from this narrower module instead of astro:assets,
breaking the circular initialization dependency that caused a TDZ
ReferenceError when prerendered pages using <Picture> were bundled in the
same chunk as content collection render() calls.

* chore: add changeset for Picture TDZ fix

* fix: rename virtual module to virtual:astro:get-image

Use colon separator (virtual:astro:*) instead of hyphen so the module
matches existing optimizeDeps.exclude patterns in both Astro core and
the Cloudflare adapter. The hyphenated name was not excluded from
Vite's dependency optimizer, causing esbuild to fail resolving it.

* fix: add virtual:astro:get-image to dev-only.d.ts and remove ts-expect-error

Add type declaration for the virtual:astro:get-image module so TypeScript
recognizes the import without needing a @ts-expect-error directive.

* Apply suggestion from @alexanderniebuhr

---------

Co-authored-by: uni <[email protected]>

* Revives UnoCSS in dev mode when used with the client router (#16242)

* [ci] format

* chore: inline dlv dependency (#16259)

* chore: inline dlv dependency

* format

* Create three-kids-camp.md

* fix: use `for...of`

* [ci] format

* chore: upgrade biome (#16246)

* [ci] format

* [ci] release (#16244)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* test: port 16 routing unit tests to TypeScript (#16266)

* [ci] format

* refactor(core): rename logger internal types (#16271)

Co-authored-by: Princesseuh <[email protected]>

* Bump @qwik.dev/partytown to v0.13.2 (#16265)

Co-authored-by: Emanuele Stoppa <[email protected]>

* Consolidate inline script escaping into shared utility (#16303)

* Consolidate inline script escaping into shared stringifyForScript utility

Unify the two separate script-embedding escape approaches (defineScriptVars
and safeJsonStringify) into a single stringifyForScript function in escape.ts.
Uses a comprehensive < escape strategy rather than pattern-matching specific
tag sequences, covering all ETAGO variants in one pass.

* Add changeset

* Update changeset description

* Fix stringifyForScript to handle undefined values

* Update astro-directives test assertion for new escape sequence

* Skip actions server-output validation when an adapter is configured (#16202)

* Fix .svelte files in node_modules with Cloudflare prerenderEnvironment: node (#16210)

* fix(cloudflare,svelte): resolve .svelte files in node_modules with prerenderEnvironment: 'node'

Packages that ship .svelte files (e.g. bits-ui) failed with 'Unknown file
extension .svelte' when using the Cloudflare adapter with
prerenderEnvironment: 'node'. Two issues caused this:

1. The cf-externals plugin set top-level ssr.noExternal = true, which
   caused vitefu's crawlFrameworkPkgs to return an empty noExternal list
   (it assumed everything was already noExternal). This only applied to
   the ssr environment in Vite 6, leaving the prerender environment
   without the needed noExternal entries.

2. The createNodePrerenderPlugin disabled dep optimization entirely for
   the prerender environment (noDiscovery: true, include: []).

The fix removes ssr.noExternal = true from cf-externals, removes the dep
optimization override, and has @astrojs/svelte use crawlFrameworkPkgs to
discover svelte packages and add them to resolve.noExternal for all
server environments via configEnvironment.

* add changeset

* fix: use fileURLToPath for cross-platform root path

* test: add response body to assertion error for CI debugging

* fix: rename fake-svelte-pkg/dist to src to avoid .gitignore exclusion

* [ci] format

* fix: avoid full-reload in scss modules (#14924)

* fix: avoid full-reload in scss modules

* fix: improve regex

* fix: ci

* test: add test for modules

* fix(hmr): prevent full-reload for SCSS/CSS module changes

SCSS and CSS module file changes were triggering unnecessary full page
reloads during development instead of applying HMR updates. This broke
the developer experience by losing component state and scroll position
on every style edit.

Root cause: In the `astro:hmr-reload` Vite plugin, style files (CSS,
SCSS, SASS, LESS, etc.) in the SSR module graph were correctly skipped
via a regex check, but the handler returned `undefined` instead of an
empty array. In Vite 6, returning `undefined` from a `hotUpdate` hook
means "I didn't handle this", causing Vite to propagate through the SSR
module graph to `.astro` importers. Since `.astro` pages have no HMR
boundary, this triggered a full page reload.

Changes to `vite-plugin-hmr-reload`:

- Extract `isStyleModule()` helper that checks both `mod.file` and
  `mod.id` (stripping query params like `?inline`, `?used`) against
  the style extension regex. This correctly identifies all style-related
  modules including CSS module variants.

- Return `[]` (empty array) when only style modules were encountered
  in the SSR environment. This tells Vite "handled, nothing to update
  in SSR", preventing the propagation chain that caused full reloads.
  The client environment handles CSS HMR natively through
  framework-specific HMR boundaries (Preact, React, Vue, etc.).

Changes to e2e test fixtures:

- Update the SCSS module HMR test to use a Preact component with
  `client:load` instead of a pure server-rendered Astro page. This
  matches the real-world scenario from the original bug report (issue
  #14869) where Preact + SCSS modules triggered full reloads. CSS
  module HMR requires a client-side framework to re-render components
  with updated class name hashes — pure SSR pages cannot hot-update
  CSS module class names without a full reload.

Closes #14869

* fix(hmr): clarify comment about CSS HMR working for all pages

The previous comment suggested CSS HMR only worked through
framework-specific boundaries. Vite's built-in style update
mechanism handles it for all pages, with or without framework
components (covered by the scss-external test).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* update pnpm-lock.yaml

* chore: add changeset for SCSS/CSS module HMR fix

---------

Co-authored-by: Erika <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Matthew Phillips <[email protected]>
Co-authored-by: Matthew Phillips <[email protected]>

* [ci] release (#16281)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(dev): preserve --port flag after Vite-triggered server restart (#16311)

* fix(dev): preserve custom port across Vite-triggered server restarts

* chore: add changeset for --port fix

---------

Co-authored-by: astrobot-houston <[email protected]>

* fix: add checkout step back to mergeability check (#15783)

* refactor: unit tests that are integration tests (#16280)

* refactor: unit tests that are integration tests

* refactor(test): move teardown.js to TypeScript

* refactor(test): move assets/fonts/utils.js to TypeScript

* refactor(test): move i18n/test-helpers.js to TypeScript

* refactor(test): move app/test-helpers.js to TypeScript

* refactor(test): move routing/test-helpers.js to TypeScript

* refactor(test): add TypeScript version of test-utils (JS kept for unconverted consumers)

* refactor(test): add TypeScript versions of mocks and build/test-helpers (JS kept for unconverted consumers)

* refactor(test): convert Group A batch 1 tests to TypeScript

* refactor(test): move action-status.test.js to TypeScript

* refactor(test): move actions-app.test.js to TypeScript

* refactor(test): move app/csrf.test.js to TypeScript

* refactor(test): move app/astro-response.test.js to TypeScript

* refactor(test): move app/astro-attrs.test.js to TypeScript

* refactor(test): move app/encoded-backslash-bypass.test.js to TypeScript

* refactor(test): move app/double-slash-bypass.test.js to TypeScript

* refactor(test): move app/error-pages.test.js to TypeScript

* refactor(test): move app/locals.test.js to TypeScript

* refactor(test): move app/response.test.js to TypeScript

* refactor(test): move app/trailing-slash.test.js to TypeScript

* refactor(test): move assets/getImage.test.js to TypeScript

* refactor(test): move assets/fonts/infra.test.js to TypeScript

* refactor(test): move assets/fonts/core.test.js to TypeScript

* refactor(test): move noop.test.js to TypeScript

* refactor(test): move call-middleware.test.js to TypeScript

* refactor(test): move preserve-build-client-dir.test.js to TypeScript

* refactor(test): move sequence.test.js to TypeScript

* refactor(test): move rendering.test.js to TypeScript

* refactor(test): move server-islands.test.js to TypeScript

* refactor(test): move sec-fetch.test.js to TypeScript

* refactor(test): move middleware-app.test.js to TypeScript

* refactor(test): move generate.test.js to TypeScript

* refactor(test): move router.test.js to TypeScript

* refactor(test): move i18n-middleware.test.js to TypeScript

* refactor(test): move i18n-app.test.js to TypeScript

* refactor(test): move head-injection-app.test.js to TypeScript

* refactor(test): move fallback.test.js to TypeScript

* refactor(test): move render-context.test.js to TypeScript

* refactor(test): move i18n-routing-static.test.js to TypeScript

* refactor(test): move i18n-static-build.test.js to TypeScript

* refactor(test): move paginate.test.js to TypeScript

* refactor(test): move context-helpers.test.js to TypeScript

* refactor(test): move manual-routing.test.js to TypeScript

* refactor(test): move html-primitives.test.js to TypeScript

* refactor(test): move manual-middleware.test.js to TypeScript

* refactor(test): move class-list-and-style.test.js to TypeScript

* refactor(test): move create-manifest.test.js to TypeScript

* refactor(test): move api.test.js to TypeScript

* refactor(test): move manifest.test.js to TypeScript

* refactor(test): move hooks.test.js to TypeScript

* refactor(test): move route-matching.test.js to TypeScript

* refactor(test): move get-params.test.js to TypeScript

* refactor(test): move render.test.js to TypeScript

* refactor(test): move static-build.test.js to TypeScript

* refactor(test): move rewrite-app.test.js to TypeScript

* refactor(test): move rewrite-validation.test.js to TypeScript

* refactor(test): move params-encoding.test.js to TypeScript

* refactor(test): delete old JS helpers and fix remaining .js import references to .ts

* refactor(test): update test:unit script for all-TypeScript unit tests

* refactor(test): remove dev-hydration test, extract integration-test-helpers for createRequestAndResponse

* fix(test): update unit tests for Logger→AstroLogger rename and API changes from main

* refactor: address linting

* refactor(test): replace fixable any types with proper types across unit tests

* fix tests

* Surface console output from workerd during Cloudflare prerendering (#16307)

* Surface console output from workerd during prerendering

* Filter out HTTP request logs from prerender server output

* Narrow log filter to only match internal __astro_ request paths

* Fix lint: disable no-control-regex for ANSI pattern, use non-capturing group

* fix(core): svg via f=svg (#16316)

* Fix static asset error responses including immutable cache headers (#16319)

* fix(node): prevent cache poisoning from conditional request errors

Move immutable cache header from send's 'headers' event to 'stream'
event so it is only set on successful responses. The 'headers' event
fires before precondition checks (If-Match, If-Unmodified-Since),
which meant error responses (412) were sent with
Cache-Control: public, max-age=31536000, immutable — allowing an
attacker to poison CDN caches with a single malformed If-Match request.

Also propagate the real HTTP status from send's error object instead
of always returning 500.

* add changeset

* update changeset wording

* Use redirect: manual in Cloudflare image binding transform (#16320)

* Use redirect: 'manual' in cloudflare image-binding-transform fetch

* Fix unused parameter lint error

* test: add unit test for dlv util (#16262)

* fix: netrify image validation (#16027)

* fix(netlify): enforce validation for remote image dimensions

* test(netlify): add regression test for missing image dimensions

* fix: astro.config.mjs file

* feat: changeset

* delete: unnecessary file

* fix: refactor to use loadFixture and project test infrastructure

* fix: update changeset

* fix: changeset explanation and refactor test code

* refactor(assets): move verifyOptions export to internal to avoid hydration regressions

* [ci] format

* Add nightly Semgrep security scanning workflow (#16205)

Co-authored-by: Felix Schneider <[email protected]>
Co-authored-by: Emanuele Stoppa <[email protected]>

* ci: cron job semgrep (#16336)

* Update github-actions (#16146)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [ci] release (#16314)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: add rule for detecting incorrect imports (#16343)

* refactor: migrate react tests to typescript (#16318)

* refactor: migrate custom 404 tests to typescript (#16350)

* refactor: migrate vue tests to typescript (#16349)

* refactor: migrate vue tests to typescript

* fix import path

* chore: trigger ci

* fix(deps): update language tools (#16230)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: fix lock file (#16352)

* refactor: migrate sitemap tests to typescript (#16353)

* fix: stabilize client build output filenames across runs (#16348)

Co-authored-by: Emanuele Stoppa <[email protected]>

* changeset: add changeset for telemetry changes (#16257)

* refactor: migrate alpinejs tests to typescript (#16354)

* fix(core): fix append of assetQueryParams to inter-chunk JS *dynamic* imports (#16258) (#16282)

Co-authored-by: Leif Marcus <[email protected]>

* refactor: migrate markdoc tests to typescript (#16355)

* refactor: migrate astro-rss tests to typescript (#16357)

* fix(dev): Passing on allowedDomains configuration. (#16317)

Co-authored-by: Emanuele Stoppa <[email protected]>

* refactor: migrate svelte tests to typescript (#16351)

* chore: remove lone fixtures (#16363)

* fix(core): clean chunk name (#16367)

* fix(core): clean chunk name

* linting and tests

* refactor: migrate telemetry tests to typescript (#16358)

* refactor: migrate telemetry tests to typescript

* format

* remove types

* format

* just use any

* format

* fix typecheck

* chore: trigger ci

* refactor(astro): migrate error tests to typescript (#16377)

* refactor(astro): migrate error tests to typescript

* chore: trigger ci

* chore: trigger ci

* refactor(upgrade): migrate tests to typescript (#16372)

* refactor(upgrade): migrate tests to typescript

* add ShellFunction type

* fix(netlify): correct test describe signature (#16371)

* chore: reduce fixtures by merging them (#16364)

* feat: tweak issue auto-triage (#16284)

* [ci] format

* chore: absorb tests into others (#16365)

* perf(core): cache crawl result (#16381)

* refactor(astro): correct Fixture type signatures in test-utils (#16380)

* refactor(astro): correct Fixture type signatures in test-utils

* chore: trigger ci

* chore: trigger ci

* Improves Vue scoped style handling in DEV mode during client router navigation. (#16379)

* Improves Vue scoped style handling in DEV mode during client router navigation.

* invert test

* streamline Vue scoped style detection in DEV mode

* [ci] format

* refactor(mdx): migrate tests to typescript (#16359)

* refactor(vercel): migrate tests to typescript (#16360)

* chore(deps): update `@types/node` (#16362)

* [ci] release (#16356)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* refactor(node): migrate unit tests to typescript (#16388)

* refactor(remark): migrate tests to typescript (#16392)

* fix(i18n): respect trailingSlash config in domain routing (#16022)

Co-authored-by: ematipico <[email protected]>

* refactor(mdx): add SpyIntegrationLogger for test (#16384)

* refactor: remove PRERENDER env variable in tests (#16391)

* refactor(underscore-redirects): migrate tests to typescript (#16374)

* refactor(cloudflare): migrate tests to typescript (#16378)

* refactor(astro): migrate css tests to typescript (#16393)

* refactor(internal-helpers): migrate tests to typescript (#16401)

* refactor(netlify): migrate tests to typescript (#16395)

* refactor(astro): migrate ssr tests to typescript (#16394)

* refactor(node): migrate tests to typescript (#16376)

* refactor(create-astro): migrate tests to typescript (#16400)

* refactor(db): migrate tests to typescript (#16403)

* refactor(astro): migrate e2e tests to typescript (#16402)

* refactor(astro): migrate 39 tests to typescript (#16405)

* refactor(astro): migrate 9 tests to typescript (#16410)

* [ci] format

* refactor(astro): migrate dev tests to typescript (#16408)

* refactor(astro): migrate content tests to typescript (#16409)

* refactor(astro): migrate 10 tests to typescript (#16411)

* refactor(astro): migrate 19 tests to typescript (#16414)

* refactor(vercel): remove duplicated test files (#16416)

* refactor(astro): migrate core-image tests to typescript (#16413)

* refactor(astro): migrate 4 tests to typescript (#16427)

---------

Signed-off-by: Alexander Niebuhr <[email protected]>
Co-authored-by: Matthew Phillips <[email protected]>
Co-authored-by: Houston (Bot) <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin DONADIEU <[email protected]>
Co-authored-by: Martin DONADIEU <[email protected]>
Co-authored-by: dataCenter430 <[email protected]>
Co-authored-by: tmimmanuel <[email protected]>
Co-authored-by: tmimmanuel <[email protected]>
Co-authored-by: BitToby <[email protected]>
Co-authored-by: Rafael Yasuhide Sudo <[email protected]>
Co-authored-by: Alexander Niebuhr <[email protected]>
Co-authored-by: astrobot-houston <[email protected]>
Co-authored-by: Alexander Niebuhr <[email protected]>
Co-authored-by: Desel72 <[email protected]>
Co-authored-by: Misrilal <[email protected]>
Co-authored-by: Matthew Phillips <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Schahin <[email protected]>
Co-authored-by: Florian Lefebvre <[email protected]>
Co-authored-by: fkatsuhiro <[email protected]>
Co-authored-by: travisBREAKS <[email protected]>
Co-authored-by: Tadao <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Amar Reddy <[email protected]>
Co-authored-by: Alex Dombroski <[email protected]>
Co-authored-by: Alex Dombroski <[email protected]>
Co-authored-by: uni <[email protected]>
Co-authored-by: Martin Trapp <[email protected]>
Co-authored-by: Martin Trapp <[email protected]>
Co-authored-by: Roman <[email protected]>
Co-authored-by: barry <[email protected]>
Co-authored-by: Princesseuh <[email protected]>
Co-authored-by: ChrisLaRocque <[email protected]>
Co-authored-by: Aral Roca Gomez <[email protected]>
Co-authored-by: Alejandro Romano <[email protected]>
Co-authored-by: Ciaran Moran <[email protected]>
Co-authored-by: Fred K. Schott <[email protected]>
Co-authored-by: Felix Schneider <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ocavue <[email protected]>
Co-authored-by: James Murty <[email protected]>
Co-authored-by: Leif Marcus <[email protected]>
Co-authored-by: Peter Philipp <[email protected]>
Co-authored-by: Erika <[email protected]>
Co-authored-by: Maxim Slobodchikov <[email protected]>
Co-authored-by: Mathieu Mafille <[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) pr preview Apply this label to a PR to generate a preview release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image breaks on prerendering whenever there is another file with getStaticPaths and render(content)

5 participants