Skip to content

i18n: every localized string renders as "key 'X (en)' returned an object instead of string" on github.com's own Support app #418

Open

Description

@tannevaled

Found while re-rendering GitHub Support's own page (support.github.com/request/landing) after the engine#412/#413 dynamic-import fix (round 32/33, PR #417 + this round's require() bridge) actually got the page rendering real content for the first time. Separate from both goja parser gaps those rounds closed.

Once the page's real sign-in UI renders (header, "Sign in with GitHub"/"Sign in with GHE" buttons, footer), every localized string shows as literal key 'X (en)' returned an object instead of string instead of the real translated text — e.g. "key 'Sign in to GitHub Help (en)' returned an object instead of string." in place of "Sign in to GitHub Help".

One other JS error is logged on the same page, likely related:

engine: run .../application-a3ab7b1990bcc98b77ee.js: TypeError: Object has no member 'createDocument' at 86716 (.../440-83e7859f09dfb5d1809b.js:2266:52(1595))

document.implementation.createDocument is not implemented by this engine (confirmed: no createDocument anywhere in js/). The 440 chunk (an Azure Blob Storage SDK bundle, unrelated to the i18n library itself) throws reaching for it; whatever the page's own i18n helper does afterward falls back to a path that stringifies its own internal lookup-result object literally instead of the resolved string, producing the key '...' returned an object instead of string. text seen in every label.

Not yet root-caused further (not isolated from a minimal repro, not confirmed whether createDocument is really the cause or just a coincidentally-logged, unrelated error on the same page) — filing now so it's tracked, rather than folding it into #412/#413's own already-closed scope.

Prior art: priorart "createDocument Object has no member" at 2026-11-10 16:00 CET reported prior art; checked: ran priorart for 'i18n translation key returned object instead of string' and 'createDocument Object has no member' against this repo; both returned only generic bag-of-words noise (common terms like object/returned/member matching unrelated PRs), no real duplicate found

Activity

  1. tannevaled commented on Nov 13, 2026

    @tannevaled
    ContributorAuthor

    Reopening — this was auto-closed by GitHub when PR #421 merged, but the PR explicitly did NOT claim to fix this issue's own visible symptom.

    PR #421 fixed a real, separate crash (document.implementation.createDocument missing), which was found alongside this issue but is NOT its root cause: re-rendering the real page after that fix confirms the JS error is gone, but the i18n text (key 'X (en)' returned an object instead of string.) is byte-identical to before.

    The actual cause (see FIDELITY.md's "Known gaps" and round 35 entry): i18next's own hardcoded fallback message, firing because a resolved translation value's typeof isn't a primitive and this.i18nFormat is unset/ineffective on this page — ruled out a goja JSON.parse bug directly. Root-causing WHY i18next's own format plugin isn't active here needs tracing its async plugin-initialization path inside a large minified bundle, which is deeper than the round that found this covered. Left open on purpose.

  2. tannevaled commented on Nov 14, 2026

    @tannevaled
    ContributorAuthor

    Round 36 (PR #423, FIDELITY.md) narrowed this further without fixing it. Ruled out, each via a live isolated reproduction against the real engine:

    • Plural resolution (Intl.PluralRules + a real i18next instance with pluralized keys resolves correctly)
    • The resource shape (fetched the real en-helphub-i18next.json this page serves: a flat string map, no nesting, no ICU AST)
    • JSON.parse at scale (the real 208KB file parses correctly, all 1958 keys)
    • Response.ok / the http-backend request path
    • The backend-connector/resourceStore wiring (a real i18next core + real i18next-http-backend, pointed at the real remote locale URL, resolve every key correctly end to end on this engine)
    • A generic settle/async-timing gap (a slow fetch-then-mutate chain settles correctly)

    What's left, by elimination: almost certainly react-i18next's own not-ready placeholder path interacting with how this engine's settle-quiescence detection treats a React re-render triggered by i18next's loaded event — the same general territory as the already-documented, unresolved react.dev hydration gap (not confirmed as the same bug). Confirming it needs the real react-dom/react-i18next bundles actually reconciling inside this engine, which is a materially larger investigation than this round's budget.

  3. tannevaled commented on Nov 15, 2026

    @tannevaled
    ContributorAuthor

    Round 47 (PR #442): narrowed further, root cause still open.

    Round 36's own theory — a react-i18next/settle-quiescence interaction — was built directly (real React + ReactDOM + i18next + i18next-http-backend + react-i18next reconciling inside this engine, with a real async backend delay) and did NOT reproduce the bug; that generic mechanism works correctly on this engine.

    Instead, patched the REAL, currently-served GitHub chunk (911-fd88881beb259e08c065.js) with a few one-line console.log probes at exact, verified-unique text anchors, and rendered the real page end to end via engine.Render against the live support.github.com/request/landing (a custom http.RoundTripper substitutes only that one chunk's bytes; everything else — CSS, fonts, every other script, the real locale JSON — still goes to the real network).

    For all 58 real t() calls the page makes, i18next's own resolve() returns the CALLER'S OWN OPTIONS OBJECT as the "resolved" value (e.g. for t('Help', {defaultValue:'Help', ...}), the resolved value prints as {"defaultValue":"Help","lngs":null,"ns":"translation"}), without ever calling the real ResourceStore.getResource — a probe at that exact call site inside resolve() got zero hits across all 58 calls. resolve()'s own entry point runs with sane values; every nested forEach inside its body appears to be skipped entirely. The most likely engine-level theory (a nested function's own var accumulator somehow leaking/sharing an outer binding) was tested in isolation and ruled out — goja scopes it correctly there.

    Net: a much more precise, directly observed symptom, but the exact mechanism by which resolve() skips its own lookup logic and returns the options object instead remains open. Full writeup in FIDELITY.md's round 47 entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions