withastro / adapters

Home for Astro's core maintained adapters
47 stars 26 forks source link

Hybrid Cloudflare build fails with 'Uncaught TypeError: Iterator value undefined is not an entry object' #245

Closed ekojsalim closed 2 months ago

ekojsalim commented 2 months ago

Astro Info

Astro                    v4.6.3
Node                     v20.10.0
System                   Linux (x64)
Package Manager          pnpm
Output                   hybrid
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/sitemap

Describe the Bug

Building the project is successful but running the Wrangler preview results in this error.

✘ [ERROR] service core:user:worker: Uncaught TypeError: Iterator value undefined is not an entry object

    at null.<anonymous> (nr2amrcapis.js:10399:15)

✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

Likely the same issue as @lokmanm reported here. Downgrading to "@astrojs/cloudflare": "10.1.0" seems to resolve this, maybe still a regression leftover not fixed by #238.

I've provided a minimal reproduction below. This bug appears to happen when there are 2 routes with one having export const prerender = true;.

What's the expected result?

The Wrangler preview to be working.

Link to Minimal Reproducible Example

https://github.com/ekojsalim/astro-iterator-repro

Participation

alexanderniebuhr commented 2 months ago

Yeah thanks, that is a leftover, a fix is pending. Thanks for the example!