Open itsayellow opened 1 month ago
Just tried this in Safari, and it does work as expected on Safari without a Traceback.
I found that this can be fixed so no error occurs if you do the following:
In .venv/lib/python3.12/site-packages/mesop/web/src/app/editor/web_package
, add a subdirectory called .well-known
, and inside a file called gpc.json
that contains the following:
{
"gpc": false,
"lastUpdate": "2024-07-18"
}
At the very least, if it is not desirable to add this directory/file, it would be nice if mesop would not throw an error with a traceback when it is requested by a browser.
Thanks for reporting this - looks like Firefox has a specific setting which sends a request for gpc.json - https://support.mozilla.org/en-US/kb/global-privacy-control.
Just to double-check, besides the terminal error message, the Mesop app is still working as expected?
Just to double-check, besides the terminal error message, the Mesop app is still working as expected?
Yes, it seems to be working fine in the browser otherwise. Just a bit alarming to be getting Tracebacks 🙂
Thanks for reporting this - looks like Firefox has a specific setting which sends a request for gpc.json - https://support.mozilla.org/en-US/kb/global-privacy-control.
Also I should note that I do NOT have that checkbox checked in my settings, so firefox seems to be requesting the GPC regardless of that setting.
Got it, good to know. I think Mesop could send an empty 200 response, at least in development mode, just to avoid having a traceback. In prod, I'm not very familiar with gpc.json and we may need this to eventually be configurable by the Mesop app developer in terms of whether their app complies with this.
Reference: https://privacycg.github.io/gpc-spec/
Describe the bug I've been trying to learn mesop. I have entered the "hello world" app (https://google.github.io/mesop/getting_started/quickstart/#hello-world-app) as mesop_test.py and run
mesop mesop_test.py
. When I navigate to the mesop-provided page on Firefox 128.0, I get a Traceback in my terminal, ending with:This happens with both Python 3.11, 3.12, and with mesop 0.9.4 and 0.9.3
To Reproduce Steps to reproduce the behavior:
Expected behavior No errors in the Terminal.
Screenshots Actual Traceback (every time you invoke the page or reload the page):
Desktop System Info
Additional context Add any other context about the problem here.