{"record":{"id":"413df714fe4fddf8","repo":"quasarframework/quasar","slug":"message-at-line-lineno-col-colno-unclose-413df7","errorCode":null,"errorMessage":"${message} at line ${lineNo} col ${colNo} (unclosed comment/unclosed string/unclosed tag)","messagePattern":"(.+?) at line (.+?) col (.+?) \\(unclosed comment/unclosed string/unclosed tag\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"create-quasar/lib/template.js","lineNumber":44,"sourceCode":"function throwParseError(message, str, index) {\n  const whitespace = str.slice(0, index).split(newlineRE)\n\n  const lineNo = whitespace.length\n  const colNo = whitespace[lineNo - 1].length + 1\n\n  message +=\n    ' at line ' +\n    lineNo +\n    ' col ' +\n    colNo +\n    ':\\n\\n' +\n    '  ' +\n    str.split(newlineRE)[lineNo - 1] +\n    '\\n' +\n    ' '.repeat(colNo + 1) +\n    '^'\n\n  throw new Error(message)\n}\n\nfunction escapeRegExp(str) {\n  // From MDN\n  return str.replace(escapeRegexpRE, String.raw`\\$&`) // $& means the whole matched string\n}\n\nfunction trimWS(str, wsLeft, wsRight) {\n  // Slightly confusing,\n  // but _}} will trim the left side of the following string\n  const leftTrim = wsLeft || wsLeft === false ? wsLeft : 'nl'\n  const rightTrim = wsRight || wsRight === false ? wsRight : false\n\n  if (!rightTrim && !leftTrim) return str\n\n  if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n    return str.trim()\n  }","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/create-quasar/lib/template.js#L26-L62","documentation":"create-quasar's template.js parses scaffolding templates into an AST. When the EJS-style parser cannot close a comment, string, or tag before end-of-file, throwParseError builds a message showing the offending source line with a caret pointer and throws. It means a template asset inside create-quasar is malformed, not your project files.","triggerScenarios":"getAST encounters a template file containing an unterminated tag/comment/string literal — e.g. a template edited by hand where a closing '%>' or quote was dropped, or a line/comment opened at the end of the file.","commonSituations":"Developers customizing create-quasar's built-in templates (in template/ folders) accidentally break a tag; merge conflicts leaving conflict markers inside a template; editing templates with an editor that mangles quotes; contributing a new template with unbalanced syntax.","solutions":["Open the file/line/column named in the error message and fix the unclosed comment, string or tag (add the closing '%>', quote or comment terminator)","Check for leftover Git merge-conflict markers in the template file","If you didn't edit templates, reinstall create-quasar (npm i -g create-quasar@latest) to replace corrupted template assets","Run the failing command again to confirm parsing succeeds"],"exampleFix":"// before (template.js asset)\n<div class=\"<%= props.name\n// after\n<div class=\"<%= props.name %>\"></div>","handlingStrategy":"try-catch","validationCode":"const fs = require('fs')\nfunction looksBalanced(tpl) {\n  return (tpl.match(/<%/g) || []).length === (tpl.match(/%>/g) || []).length\n}\n// check before processing: if (!looksBalanced(fs.readFileSync(file, 'utf8'))) fix file first","typeGuard":"function isClosedTag(tpl) {\n  return typeof tpl === 'string' && (tpl.match(/<%/g) || []).length === (tpl.match(/%>/g) || []).length\n}","tryCatchPattern":"try {\n  const ast = getAST(tplPath)\n} catch (err) {\n  if (err.message.includes('unclosed')) {\n    console.error(`Malformed template at ${err.message}; restore or fix the template file`)\n  }\n  throw err\n}","preventionTips":["Never hand-edit create-quasar templates without re-running the scaffolding command afterwards","Reject merge conflicts in CI by grepping template folders for '<<<<<<<' markers","Keep a pristine copy of templates from the published package for diffing","Use an editor mode that highlights EJS tags so unclosed '%>' is visible"],"tags":["template-parsing","scaffolding","syntax-error"],"backgroundTag":"unclosed-template-tag","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}