This error is originationg from my app
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'links')
But in my support/index.js I wrote
import './commands'
Cypress.on('uncaught:exception', (err, runnable, promise) => {
if (err.message.includes("Unexpected token ':'")) {
return false
}
if (err.message.includes("TypeError")) {
return false
}
if (err.message.includes("Uncaught")) {
return false
}
})
Why cant I catch the TypeError with if err.message.includes("TypeError")
Cypress version 9.1