Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tired-ways-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"emdash": patch
---

Fixes i18n config returning null in Vite dev SSR by reading from virtual module instead of dynamic import.
8 changes: 4 additions & 4 deletions packages/core/src/emdash-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import type { Element } from "@emdash-cms/blocks";
import { Kysely, sql, type Dialect } from "kysely";
import virtualConfig from "virtual:emdash/config";

import { validateRev } from "./api/rev.js";
import type {
Expand Down Expand Up @@ -1299,11 +1300,10 @@ export class EmDashRuntime {
const authMode = getAuthMode(this.config);
const authModeValue = authMode.type === "external" ? authMode.providerType : "passkey";

// Include i18n config if enabled
const { getI18nConfig, isI18nEnabled } = await import("./i18n/config.js");
const i18nConfig = getI18nConfig();
// Include i18n config if enabled (read from virtual module to avoid SSR module singleton mismatch)
const i18nConfig = virtualConfig?.i18n;
const i18n =
isI18nEnabled() && i18nConfig
i18nConfig && i18nConfig.locales && i18nConfig.locales.length > 1
? { defaultLocale: i18nConfig.defaultLocale, locales: i18nConfig.locales }
: undefined;
Comment on lines +1303 to 1308
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes a regression-prone behavior (manifest i18n being null in Vite dev SSR), but there’s no automated coverage asserting that getManifest() includes the expected i18n payload when multiple locales are configured. The integration test fixture already configures i18n.locales with multiple values; please add a test assertion that the manifest response contains i18n with the configured defaultLocale and locales so this doesn’t silently break again.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback


Expand Down
Loading