diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts index f5c05d0a5..40d28abcd 100644 --- a/packages/astro/src/core/render/core.ts +++ b/packages/astro/src/core/render/core.ts @@ -21,7 +21,7 @@ export const enum GetParamsAndPropsError { } export async function getParamsAndProps(opts: GetParamsAndPropsOptions): Promise<[Params, Props] | GetParamsAndPropsError> { - const { logging, mod, route, routeCache, pathname, ssr} = opts; + const { logging, mod, route, routeCache, pathname, ssr } = opts; // Handle dynamic routes let params: Params = {}; let pageProps: Props; diff --git a/packages/astro/src/core/render/route-cache.ts b/packages/astro/src/core/render/route-cache.ts index 5ae36fcb0..d181d1b1c 100644 --- a/packages/astro/src/core/render/route-cache.ts +++ b/packages/astro/src/core/render/route-cache.ts @@ -19,20 +19,22 @@ interface CallGetStaticPathsOptions { ssr: boolean; } -export async function callGetStaticPaths({ isValidate, logging, mod, route, ssr}: CallGetStaticPathsOptions): Promise { +export async function callGetStaticPaths({ isValidate, logging, mod, route, ssr }: CallGetStaticPathsOptions): Promise { validateGetStaticPathsModule(mod, { ssr }); const resultInProgress = { rss: [] as RSS[], }; let staticPaths: GetStaticPathsResult = []; - if(mod.getStaticPaths) { - staticPaths = (await mod.getStaticPaths({ - paginate: generatePaginateFunction(route), - rss: (data) => { - resultInProgress.rss.push(data); - }, - })).flat(); + if (mod.getStaticPaths) { + staticPaths = ( + await mod.getStaticPaths({ + paginate: generatePaginateFunction(route), + rss: (data) => { + resultInProgress.rss.push(data); + }, + }) + ).flat(); } const keyedStaticPaths = staticPaths as GetStaticPathsResultKeyed; diff --git a/packages/astro/test/ssr-dynamic.test.js b/packages/astro/test/ssr-dynamic.test.js index 70e3b0aee..1679cf8a3 100644 --- a/packages/astro/test/ssr-dynamic.test.js +++ b/packages/astro/test/ssr-dynamic.test.js @@ -11,14 +11,14 @@ describe('Dynamic pages in SSR', () => { projectRoot: './fixtures/ssr-dynamic/', buildOptions: { experimentalSsr: true, - } + }, }); await fixture.build(); }); it('Do not have to implement getStaticPaths', async () => { const app = await fixture.loadSSRApp(); - const request = new Request("http://example.com/123"); + const request = new Request('http://example.com/123'); const route = app.match(request); const response = await app.render(request, route); const html = await response.text();