{"record":{"id":"53ae4dcc87651626","repo":"quasarframework/quasar","slug":"please-check-the-source-around-and-for-i","errorCode":null,"errorMessage":"Please check the source around \"<%\" and \"%>\" for invalid usage.","messagePattern":"Please check the source around \"<%\" and \"%>\" for invalid usage\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app-vite/lib/plugins/vite.html.js","lineNumber":173,"sourceCode":"        <div style=\"display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid #000;padding:20px;border-radius:4px;\">\n          <h1>HTML template compilation error</h1>\n          <p>\n            Please check the source around \"&lt;%\" and \"%&gt;\" for invalid usage.\n          </p>\n        </div>\n    </body>\n  </html>\n`\n\nfunction handleTemplateError(isProd) {\n  if (isProd) {\n    fatal(\n      `HTML template compilation failed. Please check the source around \"<%\" and \"%>\" for invalid usage.`\n    )\n  }\n\n  warn()\n  warn(\n    `Please check the source around \"<%\" and \"%>\" for invalid usage.`,\n    'HTML template compilation failed'\n  )\n  warn()\n\n  return templareErrorHtmlPage\n}\n\nasync function transformHtml(template, htmlVariables, quasarConf) {\n  let html = renderTemplate(template, htmlVariables, templateCompileOpts)\n  if (html === templateRenderError) {\n    return handleTemplateError(quasarConf.ctx.prod)\n  }\n\n  const isNonSSR = !quasarConf.ctx.mode.ssr && !quasarConf.ctx.mode.ssg\n\n  html = html.replace(\n    entryPointMarkup,","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/plugins/vite.html.js#L155-L191","documentation":"Quasar compiles index.html (and the dev SSR template) as an EJS-like template; when compilation throws, handleTemplateError reports 'HTML template compilation failed' and advises checking the source around '<%' and '%>' for invalid EJS usage. In non-fatal (dev SSR template) contexts it returns an error HTML page so the browser shows the problem.","triggerScenarios":"An invalid template expression in index.html: unterminated or malformed <% %>, a runtime ReferenceError inside <%= %> interpolation, or invalid JavaScript inside a scriptlet, during transformHtml (build/dev index.html) or getDevSsrTemplateFn (SSR dev template).","commonSituations":"Hand-editing index.html and typos in a <% code %>/<%= interpolation %> tag; injecting app config interpolation with wrong syntax; copying EJS snippets with stray '<%' or '%>'; using an undefined variable in the template scope.","solutions":["Open the app's index.html and inspect every <% and %> occurrence; fix unbalanced or malformed tags.","Simplify suspect interpolations (<%= ... %>) to static text to isolate the broken one.","Verify any referenced variables exist in the template scope (e.g. ctx, process.env) and guard with typeof if unsure.","Restore index.html from the Quasar template and reapply customizations carefully."],"exampleFix":"<!-- before -->\n<div><%= config.brandName %></div>\n<!-- after -->\n<div><%= ctx.productName %></div>","handlingStrategy":"validation","validationCode":"// Pre-check template tags are balanced before build:\nconst html = fs.readFileSync('index.html', 'utf8')\nconst opens = (html.match(/<%/g) || []).length\nconst closes = (html.match(/%>/g) || []).length\nif (opens !== closes) throw new Error('Unbalanced EJS tags in index.html')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After editing index.html, count <%/ %> occurrences for balance.","Keep interpolations simple; prefer variables provided by Quasar over inline logic.","Test the template with `quasar build` before committing template edits.","Keep index.html under version control to diff-verify template changes."],"tags":["html-template","ejs","build","syntax-error"],"backgroundTag":"template-syntax-error","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}