How to prevent error from logging to the console

I was trying to integrate Hubspot to my app. But I’m getting the error that is shown in the image.

Here is the code

https://github.com/JithinKS97/ethernaut/blob/leaderboard-integration/client/src/components/leaderboard/Hubspot.js

How can I prevent this error from being shown in the console. Please help.