diff --git a/packages/astro/src/i18n/index.ts b/packages/astro/src/i18n/index.ts index 246189f86ce0..73b33fa600c0 100644 --- a/packages/astro/src/i18n/index.ts +++ b/packages/astro/src/i18n/index.ts @@ -4,7 +4,6 @@ import { shouldAppendForwardSlash } from '../core/build/util.js'; import { REROUTE_DIRECTIVE_HEADER } from '../core/constants.js'; import { MissingLocale, i18nNoLocaleFoundInPath } from '../core/errors/errors-data.js'; import { AstroError } from '../core/errors/index.js'; -import { isRoute404, isRoute500 } from '../core/routing/match.js'; import type { AstroConfig, Locales, ValidRedirectStatus } from '../types/public/config.js'; import type { APIContext } from '../types/public/context.js'; import { createI18nMiddleware } from './middleware.js'; diff --git a/packages/astro/src/i18n/middleware.ts b/packages/astro/src/i18n/middleware.ts index 0f98fd4e21da..6b840749850f 100644 --- a/packages/astro/src/i18n/middleware.ts +++ b/packages/astro/src/i18n/middleware.ts @@ -1,5 +1,6 @@ import type { SSRManifest, SSRManifestI18n } from '../core/app/types.js'; import { REROUTE_DIRECTIVE_HEADER, ROUTE_TYPE_HEADER } from '../core/constants.js'; +import { isRequestServerIsland, requestIs404Or500 } from '../core/routing/match.js'; import type { MiddlewareHandler } from '../types/public/common.js'; import type { APIContext } from '../types/public/context.js'; import { @@ -10,7 +11,6 @@ import { redirectToFallback, requestHasLocale, } from './index.js'; -import { isRequestServerIsland, requestIs404Or500 } from '../core/routing/match.js'; export function createI18nMiddleware( i18n: SSRManifest['i18n'], diff --git a/packages/astro/test/i18n-routing.test.js b/packages/astro/test/i18n-routing.test.js index b5ecec60e1d7..ed159aed2a75 100644 --- a/packages/astro/test/i18n-routing.test.js +++ b/packages/astro/test/i18n-routing.test.js @@ -2169,8 +2169,7 @@ describe('Fallback rewrite SSR', () => { }); }); - -describe("i18n routing with server islands", () => { +describe('i18n routing with server islands', () => { /** @type {import('./test-utils').Fixture} */ let fixture; /** @type {import('./test-utils').DevServer} */ @@ -2182,10 +2181,10 @@ describe("i18n routing with server islands", () => { }); devServer = await fixture.startDevServer(); }); - + after(async () => { await devServer.stop(); - }) + }); it('should render the en locale with server island', async () => { const res = await fixture.fetch('/en/island'); @@ -2194,4 +2193,4 @@ describe("i18n routing with server islands", () => { const serverIslandScript = $('script[data-island-id]'); assert.equal(serverIslandScript.length, 1, 'has the island script'); }); -}) +});