{"record":{"id":"a9ce0073e4c60aca","repo":"GoogleChrome/lighthouse","slug":"can-only-load-ctc-files","errorCode":null,"errorMessage":"Can only load ctc files","messagePattern":"Can only load ctc files","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/scripts/i18n/bake-ctc-to-lhl.js","lineNumber":102,"sourceCode":"    }\n\n    // Check that all placeholders are gone.\n    if (message.match(/\\$\\w+\\$/)) {\n      throw Error(`Message \"${message}\" is missing placeholder(s): ${message.match(/\\$\\w+\\$/g)}`);\n    }\n\n    bakedMessages[key] = {message};\n  }\n\n  return bakedMessages;\n}\n\n/**\n * @param {string} file\n * @return {Record<string, CtcMessage>}\n */\nfunction loadCtcStrings(file) {\n  if (!file.endsWith('.ctc.json')) throw new Error('Can only load ctc files');\n\n  return readJson(file);\n}\n\n/**\n * @param {string} path\n * @param {Record<string, LhlMessage>} localeStrings\n */\nfunction saveLhlStrings(path, localeStrings) {\n  fs.writeFileSync(path, JSON.stringify(localeStrings, null, 2) + '\\n');\n}\n\n/**\n * @param {string} dir\n * @return {Array<string>}\n */\nfunction collectAndBakeCtcStrings(dir) {\n  const lhlFilenames = [];","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/scripts/i18n/bake-ctc-to-lhl.js#L84-L120","documentation":"Error \"Can only load ctc files\" thrown in GoogleChrome/lighthouse.","triggerScenarios":"Raised when bake-ctc-to-lhl is given a file that is not a .ctc file.","commonSituations":"See trigger scenarios.","solutions":["Pass a .ctc file as input to the script.","Convert the file to CTC format before baking it to LHL."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}