Skip to content

Repository files navigation

Astro prerender entry-module reproduction

This repository reproduces a stale entryModules mapping in an Astro Cloudflare server build. A prerendered page lazily imports one local module while another page remains server-rendered.

The prerender build records the lazy module's prerender filename in the shared entry-specifier map. Astro later serializes that mapping into the SSR manifest and removes the prerender output, so the production resolver returns a URL whose target is absent from the final server and client output.

Reproduce

Requirements: Node.js 24.19.0 and npm 11.17.0.

npm ci --ignore-scripts
npm run build
npm run audit
npm run test:workerd

Expected reproduction output:

{"mapped":true,"mappedTargetExists":false}
{"resolverCalls":1,"missingReturnedUrls":1}

Expected behavior: every entry specifier serialized into the SSR manifest resolves to a module or asset in that environment's final output. A prerender-only entry should not remain in the SSR resolver map after prerender output is removed.

Actual behavior: the lazy module remains mapped to its removed prerender filename, and the production resolver returns that missing URL.

The workerd check adds a diagnostic export only to the in-memory copy of Astro's generated resolver chunk. It does not alter dist; the invoked productionEnvironment.resolve implementation is the one emitted by Astro.

The project is local-only: it defines no account, route, domain, remote binding, database, secret, analytics, or deployment workflow.

About

Minimal reproduction of prerender-only entry specifiers being serialized into Astro Cloudflare SSR manifests and resolving to missing asset URLs.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages