I did the backend all over again with a proxy endpoint so now it is working. The library was trying to hit a URL that should have been handled by netlify but it was not. So now the lib is gone and everything works.