{"record":{"id":"da3b64aa553c4585","repo":"parcel-bundler/parcel","slug":"unknown-template-language-template-lang","errorCode":null,"errorMessage":"Unknown template language: \"${template.lang}\"","messagePattern":"Unknown template language: \"(.+?)\"","errorType":"exception","errorClass":"ThrowableDiagnostic","httpStatus":null,"severity":"error","filePath":"packages/transformers/vue/src/VueTransformer.js","lineNumber":238,"sourceCode":"          await options.inputFS.readFile(\n            await resolve(asset.filePath, template.src),\n          )\n        ).toString();\n        template.lang = extname(template.src).slice(1);\n      }\n      let content = template.content;\n      if (template.lang && !['htm', 'html'].includes(template.lang)) {\n        let options = {};\n        let preprocessor = consolidate[template.lang];\n        // Pug doctype fix (fixes #7756)\n        switch (template.lang) {\n          case 'pug':\n            options.doctype = 'html';\n            break;\n        }\n        if (!preprocessor) {\n          // TODO: codeframe\n          throw new ThrowableDiagnostic({\n            diagnostic: {\n              message: md`Unknown template language: \"${template.lang}\"`,\n              origin: '@parcel/transformer-vue',\n            },\n          });\n        }\n        content = await preprocessor.render(content, options);\n      }\n      let templateComp = compiler.compileTemplate({\n        filename: asset.filePath,\n        source: content,\n        inMap: template.src ? undefined : template.map,\n        scoped: styles.some(style => style.scoped),\n        isFunctional,\n        compilerOptions: {\n          ...config.compilerOptions,\n          bindingMetadata: script ? script.bindings : undefined,\n        },","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/transformers/vue/src/VueTransformer.js#L220-L256","documentation":"Thrown by @parcel/transformer-vue when a <template lang=\"...\"> uses a language other than html/htm and consolidate has no matching preprocessor (consolidate[template.lang] is undefined). The transformer looks up the renderer in the consolidate library to convert the template source to HTML before compileTemplate runs.","triggerScenarios":"template.lang is set to a value (pug, handlebars, ejs, etc.) but the corresponding consolidate engine — or its underlying npm package — is not installed, so consolidate[lang] is undefined.","commonSituations":"Using `<template lang=\"pug\">` without installing pug, or a lang value consolidate doesn't ship a key for (typo like 'pugjs' or a niche engine not bundled). Removing a previously-installed preprocessor breaks builds retroactively.","solutions":["Install the missing template engine: `npm install pug` (and ensure @parcel/transformer-vue depends on consolidate).","Correct the lang attribute to a supported consolidate engine name.","Drop the lang attribute to use plain HTML if no preprocessor is needed."],"exampleFix":"// before\n<template lang=\"pug\">div</template>  <!-- pug not installed -->\n// after\n<template lang=\"pug\">div</template>  <!-- after `npm i pug` -->\n// or\n<template><div/></template>","handlingStrategy":"validation","validationCode":"import consolidate from 'consolidate';\nconst lang = template.lang;\nif (lang && !['htm','html'].includes(lang) && !consolidate[lang]) {\n  throw new Error(`Template lang '${lang}' has no consolidate preprocessor; install it or remove the lang attribute.`);\n}","typeGuard":"function isSupportedTemplateLang(lang) {\n  return !lang || ['htm','html'].includes(lang) || Boolean(consolidate[lang]);\n}","tryCatchPattern":null,"preventionTips":["Install the engine package (pug, handlebars, ejs) before setting template lang.","Use only lang names that exist as keys on consolidate.","Default to plain HTML when no preprocessing is required."],"tags":["vue","template","preprocessor","parcel-transformer"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}