withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
43.84k stars 2.28k forks source link

Build fails when generating RSS: Cannot read properties of undefined (reading 'check') #11329

Closed johnnydecimal closed 7 hours ago

johnnydecimal commented 4 days ago

Astro Info

Astro                    v4.11.1
Node                     v21.7.1
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             auto-import
                         astro-embed
                         @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I’m still troubleshooting, but I’ll drop this here in case anyone is better at it than me. Hint: you probably are.

Since upgrading from Astro 4.9 to 4.11, my build is failing on the processing of this file. Which I understand isn’t supported, experimental etc! I’m just raising this issue in case it helps someone figure something out.

07:06:58 λ src/pages/rss.xml.ts
07:06:58   └─ /rss.xmlCannot read properties of undefined (reading 'check')
  Stack trace:
    at renderFrameworkComponent (file:///Users/john/dev/www.johnnydecimal.com/dist/chunks/astro/server_C3uKuhR1.mjs:1344:27)

Rudimentary logging tells me that the build gets as far as entering the for (const { data, slug, collection } of posts) loop at line 32. So the call that’s failing is await container.renderToString....

Update, a little more digging gets me closer to the issue.

Seems like a call to r.ssr.check fails.

file:///Users/john/dev/www.johnnydecimal.com/dist/chunks/astro/server_C3uKuhR1.mjs:1344
          if (await r.ssr.check.call({ result }, Component, props, children)) {
                          ^

TypeError: Cannot read properties of undefined (reading 'check')
    at renderFrameworkComponent (file:///Users/john/dev/www.johnnydecimal.com/dist/chunks/astro/server_C3uKuhR1.mjs:1344:27)
    at async renderComponent (file:///Users/john/dev/www.johnnydecimal.com/dist/chunks/astro/server_C3uKuhR1.mjs:1627:10)

What's the expected result?

The build succeeds.

Link to Minimal Reproducible Example

I don’t have one, sorry

Participation

github-actions[bot] commented 4 days ago

Hello @johnnydecimal. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.