summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/astro/src/core/render/core.ts2
-rw-r--r--packages/astro/test/ssr-prerender-get-static-paths.test.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts
index 6c486ae34..862ada7c8 100644
--- a/packages/astro/src/core/render/core.ts
+++ b/packages/astro/src/core/render/core.ts
@@ -47,7 +47,7 @@ export async function getParamsAndProps(
routeCache.set(route, routeCacheEntry);
}
const matchedStaticPath = findPathItemByKey(routeCacheEntry.staticPaths, params, route);
- if (!matchedStaticPath && !ssr) {
+ if (!matchedStaticPath && (ssr ? mod.prerender : true)) {
return GetParamsAndPropsError.NoMatchingStaticPath;
}
// Note: considered using Object.create(...) for performance
diff --git a/packages/astro/test/ssr-prerender-get-static-paths.test.js b/packages/astro/test/ssr-prerender-get-static-paths.test.js
index 4ffa8677e..b0253eabf 100644
--- a/packages/astro/test/ssr-prerender-get-static-paths.test.js
+++ b/packages/astro/test/ssr-prerender-get-static-paths.test.js
@@ -72,7 +72,9 @@ describe('prerender getStaticPaths - 404 behavior', () => {
it('resolves 404 on pattern match without static path - named params', async () => {
const res = await fixture.fetch('/pizza/provolone-pineapple');
+ const html = await res.text();
expect(res.status).to.equal(404);
+ expect(html).to.match(/404/);
});
it('resolves 200 on matching static path - rest params', async () => {
@@ -82,7 +84,9 @@ describe('prerender getStaticPaths - 404 behavior', () => {
it('resolves 404 on pattern match without static path - rest params', async () => {
const res = await fixture.fetch('/pizza/pizza-hut');
+ const html = await res.text();
expect(res.status).to.equal(404);
+ expect(html).to.match(/404/);
});
});