GoogleChrome/lighthouse · error

Unexpected tagName "@${tag.tagName.text}"

Error message

Unexpected tagName "@${tag.tagName.text}"

What it means

Error "Unexpected tagName "@${tag.tagName.text}"" thrown in GoogleChrome/lighthouse.

Source

Thrown at core/scripts/i18n/collect-strings.js:87

  }

  if ('tags' in ast && ast.tags) {
    // This is a complex description with description and examples.
    let description = '';
    /** @type {Record<string, string>} */
    const examples = {};

    for (const tag of ast.tags) {
      const comment = coerceToSingleLineAndTrim(tag.comment);

      if (tag.tagName.text === 'description') {
        description = comment;
      } else if (tag.tagName.text === 'example') {
        const {placeholderName, exampleValue} = parseExampleJsDoc(comment);
        examples[placeholderName] = exampleValue;
      } else {
        // Until a compelling use case for supporting more @tags, throw to catch typos, etc.
        throw new Error(`Unexpected tagName "@${tag.tagName.text}"`);
      }
    }

    if (description.length === 0) throw Error(`Empty @description for message "${message}"`);
    return {description, examples};
  }

  if (ast.comment) {
    // The entire comment is the description, so return everything.
    return {description: coerceToSingleLineAndTrim(ast.comment), examples: {}};
  }

  throw Error(`Missing description comment for message "${message}"`);
}

/**
 * Collapses a jsdoc comment into a single line and trims whitespace.
 * @param {import('typescript').JSDoc['comment']} comment

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Remove or rename the unexpected @tag in the JSDoc comment.
  2. Only use JSDoc tags supported by collect-strings (e.g. @example).

When it happens

Trigger: Raised when collect-strings encounters a JSDoc tag it does not support while parsing UIStrings.

Common situations: See trigger scenarios.


AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13). Data as JSON: /api/errors/71119ede072f2251. Report an issue: GitHub.