-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError raised in handle_javascript_response method of Client #3847
Comments
Are you using async/await properly? See https://github.com/zauberzeug/nicegui/wiki/FAQs#why-is-my-long-running-function-blocking-ui-updates |
Thanks. I did not know the 'loop.set_debug' method. After I add these code def startup():
loop = asyncio.get_running_loop()
loop.set_debug(True)
loop.slow_callback_duration = 0.05
app.on_startup(startup) I have this new warning in logs:
It seems that something related to asyncpg takes a little longer time to run. I don't know if 0.4 sec is a big issue. Anyway, the KeyError exception still occurs. I forgot to mention that my browser that I use to test, actually have some performance issues. I can notice poor performance on all web pages. |
@ruiheng Calling a function repeatedly that takes 0.4 sec can sum up and cause problems. Can you, please, try to provide a minimum reproducible example? Or should we close this issue? |
Description
This kind of exception as shown in the following logs, pops up from time to time in the logs of my app.
I don't know how to reproduce this issue. However theses errors usually occur on "slow" or complicate pages.
My guess is: after "await js_request" throws TimeoutError, the JavaScriptRequest instance gets deleted from
JavaScriptRequest._instances
dict. Subsequently, when the response of this JavaScriptRequest arrives, a KeyError is raised.Alternatively there might be some requirements for using 'ui.run_javascript' that I am not aware of.
The text was updated successfully, but these errors were encountered: