Astro Server Islands and Vercel ISR causes 404

Hello,

does Vercel support Astro Server Island components together with ISR?

I did a simple test in blank Astro project, I added Server Island component and it worked only when ISR was not enabled. If I enabled ISR, the index page loads but call to _server-island/component_name returns HTTP/404.

This was the only difference between the two builds.

    isr: {

       bypassToken: "***",
       exclude: [ "/some/path1", ...],

    }
# packages.json 
# Tested with Astro 5.0.5 and astro@latest (5.1.1)

  "dependencies": {
    "@astrojs/vercel": "^8.0.1",
    "astro": "^5.0.5"
  }
# astro.config.mjs

import vercel from '@astrojs/vercel';

export default defineConfig({
  output: "server",
  adapter: vercel({
    isr: {
       bypassToken: "***",
       exclude: [ "/some/path1", ],
    },
  }),
});

The index page is just simple call of Server Island component using server:defer.

# index.astro
---
export const prerender = false;
import TimeComponent from '../components/time.astro';
---

<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>Astro</title>
	</head>
	<body>
        <p>Timestamp: <TimeComponent server:defer /></p>
	</body>
</html>

The component itself just returns a timestamp.

# time.astro
---
const timestamp = Date.now();
---

{ timestamp }
1 Like

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

Thx bot, not helpful at all as bug report is of completely different nature.

Upgraded Astro to 5.1.2 but Server Islands still don’t work returning 404.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.