Saving widgets gives invalid JSON error

Hi all,

We are using bedrock and sage for our website. Now we did create a staging environment online and we want to set our widgets. But when we edit our widgets and click save it gives following error:

There was an error. The response is not a valid JSON response.

When we test locally the widget is saving without error. Even when we try a empty installation of bedrock and sage it gives the JSON error on the staging environment.

This is the error which is showing at the network tab:

Method Not Allowed

The requested method OPTIONS is not allowed for this URL.

Does anybody know why this happens on the staging environment?

What kind of environment, nginx or httpd (apache) with PHP-FPM?

We are running httpd (apache) with PHP-FPM.

This usually happens when a widget, shortcode, or something similar produces an error while the widgets are trying to be saved.

Are you able to narrow down which widget is causing the problem by removing them one by one until you can save?

Once the problem widget is determined you might have an easier time fixing it.