Troubleshoot: CORS Errors When Sending Feedback to Userback

If you've stumbled upon a CORS error while trying to send Feedback to Userback, this article aims to help you understand what's going on and how to fix it.

What is a CORS Error?

CORS (Cross-Origin Resource Sharing) errors occur when your website tries to interact with Userback but gets stopped at the door because it's not recognized as safe. Think of it like a security guard who doesn't know you yet.

Here's an example console message:

Access to XMLHttpRequest at 'https://api.userback.io/?postWidget' 
from origin 'https://your-website.com' has been blocked by CORS policy: 
No 'Access-Control-Allow-Origin' header is present on the requested resource.

Why Is This Happening?

If you're scratching your head because you haven't faced this issue on other websites you've developed, or if it's a new problem, here are some possible reasons:

  • Recent Updates: Your website or hosting service might have been updated recently.
  • Tightened Security: Sometimes, security settings get more strict.
  • Content Security Policy (CSP): Changes in CSP could affect the loading of fonts or other resources from external sources like Userback.

How to Fix It

Don't worry; fixing this is usually straightforward. You'll need to add a special instruction, known as a CORS header, to your website's settings. This tells Userback that it's safe to accept Feedback from your site.

Here are your options to solve this:

  1. Allow Any Task:

    Add Access-Control-Allow-Headers: *
  2. Allow Specific Feedback:

    Add Access-Control-Allow-Headers: screenshot.userback.io

You can usually do this through your hosting provider's settings. If you're not sure how they should be able to guide you.

Need More Help?

If you've tried the above steps and still face issues, or if you have more questions, feel free to reach out. We're here to help!