Problem
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:
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0" />
<meta name="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
Problem
The Lamdera compiler injects a wrapper
<html lang="en">around the app'sindex.html, hardcoding the language to English regardless of the actual page language.This is problematic for:
langattribute to understand page languageCurrent behavior
Even if
public/index.htmlspecifies<html lang="fr">, the served page contains:The
lang="en"is injected by the compiler/runtime and cannot be overridden.Expected behavior
Either:
langattribute from the user'sindex.htmllangattribute entirely and let the user'sindex.htmlcontrol itWorkaround
Currently using a Cloudflare Worker with
HTMLRewriterto rewrite thelangattribute for crawlers, but this shouldn't be necessary.Environment