Cannot read properties of undefined (reading ‘3’) when trying to use (click) events in Angular

I’m trying to make an Angular site that can search for data based on a number of input fields. When I run the site locally using ng serve it works fine, but when I compile it with ng build and host the resulting files using a Docker container, it throws the error Cannot read properties of undefined (reading '3') in the console and fails to properly load the site.

Commenting out the two buttons at the bottom of the HTML template seems to make the error go away, and the page loads properly (apart from lacking buttons) so I’m thinking the problem might be something to do with the (click) event binding. Any idea how I can fix this?

The typescript file, search.component.ts:

import { Component } from '@angular/core';
import { SearchEntry } from '../student.service';
import { StudentService } from '../student.service';

@Component({
  selector: 'app-search',
  templateUrl: './search.component.html',
  styleUrl: './search.component.css'
})
export class SearchComponent {
  constructor(private studentService: StudentService) {}
  searchParams: SearchEntry = {
    lifetimeID: '', uni: '', pid: '', lastName: '', firstName: '', gradYear: '',
    status: '', entryTerm: '', termNumber: '', program: '', cluster: ''
  };
  searchResults: SearchEntry[] = [];

  searchStudents(params: SearchEntry): void {
    const resultObs = this.studentService.searchStudents(params);
    resultObs.subscribe(results => this.searchResults = results);
  }

  clearFields(): void {
    this.searchParams = {
      lifetimeID: '', uni: '', pid: '', lastName: '', firstName: '', gradYear: '',
      status: '', entryTerm: '', termNumber: '', program: '', cluster: ''
    };
  }
}

The HTML template, search.component.html:

<div class="wrapper">
    <h4>Search for Entries</h4>
    <input [(ngModel)]="searchParams.lifetimeID" placeholder="Lifetime ID"><br>
    <input [(ngModel)]="searchParams.uni" placeholder="UNI"><br>
    <input [(ngModel)]="searchParams.pid" placeholder="PID"><br>
    <input [(ngModel)]="searchParams.lastName" placeholder="Last Name"><br>
    <input [(ngModel)]="searchParams.firstName" placeholder="First Name"><br>
    <input [(ngModel)]="searchParams.gradYear" placeholder="Grad Year"><br>
    <input [(ngModel)]="searchParams.status" placeholder="Status"><br>
    <input [(ngModel)]="searchParams.entryTerm" placeholder="Entry Term"><br>
    <input [(ngModel)]="searchParams.cluster" placeholder="Cluster"><br>
    <input [(ngModel)]="searchParams.program" placeholder="Program"><br>
    <input [(ngModel)]="searchParams.termNumber" placeholder="Term Number"><br>
    <button type="button" (click)="searchStudents(searchParams)">Search</button>
    <button type="button" (click)="clearFields()">Clear</button><br>
</div>

<app-student-list [results]="searchResults"></app-student-list>

The app-student-list component referenced on the last line of the HTML template appears to work fine on its own, so I didn’t include the code for it.