const results = resizedDetections.map(d => faceMatcher.findBestMatch(d.descriptor))
Your issue lies here. Read the error message more closely.
"Uncaught (in promise) TypeError: Cannot read property 'descriptor' of undefined"
I recommend adding some logging to see what exactly your resizedDetections array contains within each object to ensure the descriptor property exists.
try
const results = resizedDetections.map(d => {
console.dir(d);
return faceMatcher.findBestMatch(d.descriptor);
});
TO ensure the property you're gettin an error about exists. This will get you closer to finding the true culprit.