Skip to content

Commit d9f1232

Browse files
Mlaz-codeclaude
andcommitted
fix(observability): convert root rewrite to redirect; suppress Write permission noise
/ was served via rewrite (/en content at / URL). Nextra reads the locale from window.location.pathname, gets empty string from "/".split("/")[1], then calls Intl with "" → "Invalid language tag". 20+ errors per day. Fix: 301 redirect / → /en so the browser URL reflects the actual locale. Also adds Write permission denied / Permission denied to access property to IGNORED_PATTERNS — Chrome Android WebView/extension noise (file=None). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f7eb66a commit d9f1232

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

components/PostHogProvider.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const IGNORED_PATTERNS = [
2828
/Hydration failed/,
2929
/There was an error while hydrating/,
3030
/Text content did not match/,
31+
// "Write permission denied." / "Permission denied to access property" — Chrome
32+
// Android WebView sandbox / browser extension. No source file captured.
33+
/Write permission denied/,
34+
/Permission denied to access property/,
3135
]
3236

3337
function shouldIgnore(message: string): boolean {

vercel.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"cleanUrls": true,
66
"ignoreCommand": "git diff --quiet HEAD^ HEAD -- app/ components/ content/ public/ scripts/ next.config.mjs proxy.ts mdx-components.tsx package.json vercel.json",
77
"redirects": [
8+
{
9+
"source": "/",
10+
"destination": "/en",
11+
"permanent": true
12+
},
813
{
914
"source": "/en/sdks/sharpapi.d.ts",
1015
"destination": "/en/sdks/typescript",
@@ -172,10 +177,6 @@
172177
}
173178
],
174179
"rewrites": [
175-
{
176-
"source": "/",
177-
"destination": "/en"
178-
},
179180
{
180181
"source": "/ingest/static/:path*",
181182
"destination": "https://us-assets.i.posthog.com/static/:path*"

0 commit comments

Comments
 (0)