Skip to content

v3.7.x throws error "Missing visitor keys for 'undefined'" #771

Description

@ChrisMBarr

After upgrading from Prettier 3.6.2 to 3.7.4 I get the following error when I run my linter

Error when running ESLint: Missing visitor keys for 'undefined'.
Occurred while linting C:\Users\xxxx\Repositories\xxx\src\app\components\bar-select\bar-select.component.html:1
Rule: "prettier/prettier"

Here is the contents of that file, which uses Angular

@if (isSearching) {
  <div class="flex items-center justify-center">
    <mat-spinner />
  </div>
} @else {
  <div class="group m-4 flex flex-col justify-center gap-2" [ngClass]="innerClass">
    @for (item of items; track $index) {
      <button type="button" mat-flat-button class="!block !h-auto min-h-12 !bg-white text-left" (click)="select(item)">
        <div class="flex py-1">
          <div class="mr-auto">
            <div class="text-base" [innerHTML]="item.display | highlight: highlightString"></div>
            @if (item.displaySecondary) {
              <div class="text-sm text-gray-500" [innerHTML]="item.displaySecondary | highlight: highlightString"></div>
            }
          </div>
          @if (item.displayRight) {
            <div class="ml-2 content-center">
              <span class="border border-black px-4 py-1 text-base group-hover:bg-white">{{ item.displayRight }}</span>
            </div>
          }
        </div>
      </button>
    } @empty {
      <span class="text-center">{{ nullMessage }}</span>
    }
  </div>
}

Here is the contents of my .prettierrc file

{
  "plugins": ["prettier-plugin-tailwindcss"],
  "endOfLine": "auto",
  "overrides": [
    { "files": "*.html", "options": { "parser": "html" } },
    { "files": "*.component.html", "options": { "parser": "angular" } }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions