Weird "is_xhr" error when deploying Flask app to Heroku Weird "is_xhr" error when deploying Flask app to Heroku flask flask

Weird "is_xhr" error when deploying Flask app to Heroku


The Werkzeug library (dependency from Flask) recently received a major update (0.16.1 --> 1.0.0) and it looks like Flask (<=0.12.4) does not restrict the version of Werkzeug that is fetched.

You have 2 options:

  • Stick with your current version of Flask and restrict the Werkzeug version that is fetched explicitly in your application's setup.py or requirements.txt by specifying werkzeug<1.0 or werkzeug==0.16.1

  • Upgrade to a recent version of Flask (>=1.0.0), which is running fine with latest Werkzeug


Or you can just forcefully install the bustard again by calling

pip install Werkzeug==0.16.1


I have faced with this problem too.

Just temporarily fixed by directly checking in request header

request.headers.get("X-Requested-With") == "XMLHttpRequest"

not sure this help ...