A TypeError means you tried to do something with the wrong type:
let x = null
x.toString() // TypeError: Cannot read properties of null
This often happens when a variable is null or undefined and you try to access a property or call a method on it. Check that your variable has the value you expect before operating on it. Use console.log() to inspect values when debugging.