Black Lives Matter. Please consider donating to Black Girls Code today.

TypeError: Dash() got an unexpected keyword argument 'csrf_protect'


I am trying to access my page from a different domain and need to turn off CORS, however when i try this suggested solution i get the error in the title.


EDIT: I see now it was entirely removed from - it would be useful if this was added to the obsolete list so a more informative error comes up in future, given it appears in so many previous solutions

For future reference, we recommend looking at the package’s file when you upgrade:

1 Like

Fair enough, although I did not upgrade, i was already using the latest version but looking at (not so old) solutions which referenced that keyword.

I have a related question: I still have the underlying problem. I am trying to embed the dash app as a div using ngrok as a test bed and so get

No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

as the browser error.

Is there a way to access the underlying Flask app to fix this? I have tried a variety of suggestions with flask-cors and so on but nothing seems to work. I think it would work if i can access the specific response headers given in a layout back to the browswer, is that possible?

EDIT: problem solved, extracted the server via CORS(app.server)

What was the CORS config that you used? I am running into this same issue. Thanks!