{"record":{"id":"bd0711ecf69a604f","repo":"sveltejs/kit","slug":"character-escape-sequence-in-id-must-be-lowerca","errorCode":null,"errorMessage":"Character escape sequence in ${id} must be lowercase","messagePattern":"Character escape sequence in (.+?) must be lowercase","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/sync/create_manifest_data/index.js","lineNumber":142,"sourceCode":"\tconst routes_base = posixify(path.relative(cwd, config.files.routes));\n\n\tconst valid_extensions = [...config.extensions, ...config.moduleExtensions];\n\n\t/** @type {import('types').PageNode[]} */\n\tconst nodes = [];\n\n\t// create route data by processing files in `src/routes`\n\tif (fs.existsSync(config.files.routes)) {\n\t\t/**\n\t\t * @param {number} depth\n\t\t * @param {string} id\n\t\t * @param {string} segment\n\t\t * @param {import('types').RouteData | null} parent\n\t\t */\n\t\tconst walk = (depth, id, segment, parent) => {\n\t\t\tconst unescaped = id.replace(/\\[([ux])\\+([^\\]]+)\\]/gi, (match, type, code) => {\n\t\t\t\tif (match !== match.toLowerCase()) {\n\t\t\t\t\tthrow new Error(`Character escape sequence in ${id} must be lowercase`);\n\t\t\t\t}\n\n\t\t\t\tif (!/[0-9a-f]+/.test(code)) {\n\t\t\t\t\tthrow new Error(`Invalid character escape sequence in ${id}`);\n\t\t\t\t}\n\n\t\t\t\tif (type === 'x') {\n\t\t\t\t\tif (code.length !== 2) {\n\t\t\t\t\t\tthrow new Error(`Hexadecimal escape sequence in ${id} must be two characters`);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn String.fromCharCode(parseInt(code, 16));\n\t\t\t\t} else {\n\t\t\t\t\tif (code.length < 4 || code.length > 6) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Unicode escape sequence in ${id} must be between four and six characters`\n\t\t\t\t\t\t);\n\t\t\t\t\t}","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/sync/create_manifest_data/index.js#L124-L160","documentation":"SvelteKit route folders support character escapes like `[u+1f600]` or `[x41]` to embed Unicode/hex characters in route paths. The escape sequence (including the bracket marker u/x and hex digits) must be entirely lowercase; an uppercase variant such as `[U+1F600]` or `[x+4A]` is rejected during route scanning.","triggerScenarios":"Naming a route directory with an uppercase escape: `src/routes/[U+1F4A9]/+page.svelte` or mixed case like `[u+1F600]` — detected by walk() when creating manifest data (dev server start or build).","commonSituations":"Copying emoji route examples from docs where the hex digits were uppercased; editors auto-capitalizing folder names; manually typing hex codes in uppercase.","solutions":["Lowercase the entire escape sequence in the directory name, e.g. `[u+1f600]`","Lowercase both the type marker (`u`/`x`) and all hex digits","Rename the folder and update any links pointing at the old path"],"exampleFix":"// before\n// src/routes/[U+1F600]/+page.svelte\n\n// after\n// src/routes/[u+1f600]/+page.svelte","handlingStrategy":"validation","validationCode":"// validate folder names before committing\nconst bad = /\\[[ux]\\+[^\\]]*\\]/i;\nfor (const name of routeFolders) {\n  const m = name.match(bad);\n  if (m && m[0] !== m[0].toLowerCase()) console.error('Lowercase required:', name);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await dev();\n} catch (e) {\n  if (String(e.message).includes('must be lowercase')) {\n    console.error('Lowercase the [u+..]/[x+..] escape in the named route folder');\n  }\n  throw e;\n}","preventionTips":["Type escape sequences entirely in lowercase, including hex digits","Copy folder names from docs exactly instead of retyping","Disable editor auto-capitalization for route folder names"],"tags":["routing","routes","unicode","naming"],"backgroundTag":"invalid-route-escape-sequence","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}