You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Lamdera compiler injects a wrapper <html lang="en"> around the app's index.html, hardcoding the language to English regardless of the actual page language.
This is problematic for:
SEO: Google uses the lang attribute to understand page language
Accessibility: Screen readers rely on it for pronunciation
Multi-language apps: Apps serving content in French, Spanish, etc. are incorrectly marked as English
Current behavior
Even if public/index.html specifies <html lang="fr">, the served page contains:
<htmllang="en"><head><metacharset="utf-8" /><metaname="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0" /><metaname="apple-mobile-web-app-capable" content="yes" /><style>body{padding:0;margin:0;}</style><!-- then the user's index.html head content -->
The lang="en" is injected by the compiler/runtime and cannot be overridden.
Expected behavior
Either:
Respect the lang attribute from the user's index.html
Omit the lang attribute entirely and let the user's index.html control it
Workaround
Currently using a Cloudflare Worker with HTMLRewriter to rewrite the lang attribute for crawlers, but this shouldn't be necessary.
Environment
Lamdera compiler: latest (March 2026)
Affects all Lamdera apps serving non-English content
Activity
miniBill commentedon Mar 19, 2026
You can set the
langattribute on the elements inside thebody. This is not perfect, SEO will still be wrong, but it could help with accessibilityAllow configuring <html lang> via html-lang file