I have encountered this issue with my SharePoint 2013 server farm. Code was working fine with the development machine but once it deployed to Share Point 2013 production environment; found this error on Chrome console.
Message was straight forward so I thought it is a permission issue. When I logged using my credentials It was fine and worked but when I logged out and view as a Anonymous user it didn’t work.
Then I tried to give permission to EveryOne to the list , web even for the site collection and it didn’t work either.
then I found out it’s a property in web application which handles the Anonymous calls to the Web Application and it’s the
Using a simple PowerShell you can remove these properties and make it work.
I ran this script in the App server and it worked.