Skip to content

Server Islands causing build error "Could not find server component name" #15903

@soklovsk

Description

@soklovsk

Astro Info

Astro                    v6.0.4
Vite                     v7.3.1
Node                     v25.6.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  @astrojs/node (v10.0.1)
Integrations             none

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

No response

Describe the Bug

Related to 15753 which was partially fixed in 6.0.4 release.

The bug still occurs for projects that have both pre-rendered and ssr pages of which both use different components as server islands – see the linked repo.

 prerendering static routes
15:57:49   ├─ /two/index.html15:57:49 [ERROR] Error: Could not find server component name /Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/src/components/B.astro
    at ServerIslandComponent.getIslandContent (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/transition_BEq4kZVr.mjs:1039:13)
    at ServerIslandComponent.init (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/transition_BEq4kZVr.mjs:979:32)
    at bufferHeadContent (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:2655:37)
    at renderToAsyncIterable (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:2672:11)
    at async renderPage (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:3826:24)
    at async lastNext (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:6487:25)
    at async callMiddleware (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:3929:10)
    at async RenderContext.render (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:6521:73)
    at async BuildApp.render (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/dist/server/.prerender/chunks/prerender_CLNdbEj0.mjs:7420:20)
    at async generatePathWithPrerenderer (file:///Users/soklovsk/Documents/dev/research/astro-mixed-islands-fails/node_modules/astro/dist/core/build/generate.js:247:16)

What's the expected result?

The build should succeed, it's a bug.

Link to Minimal Reproducible Example

https://github.com/soklovsk/astro-mixed-islands-bug

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions