-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
Dynamic properties mimetype fix #1594
Dynamic properties mimetype fix #1594
Conversation
Tested the additional Given this error seems to affect only certain systems additional testers would be welcome. |
If you can take a quick look in
If so I can "break" my PC similarly to test this out. Are you running directly in Windows 10 or using WSL? |
I have the issue when using Win 11 directly (no WSL). Confirming that |
This is originally a Windows/Starlette issue which other projects also have build workarounds for: encode/starlette#829 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR, @thetableman!
I have two questions:
- Can we move the lines into nicegui.py close to
static_files = StaticFiles(...)
. I think this is the place that actually requires the fix. - I think the correct mime type for JavaScript would be "text/javascript" (see https://stackoverflow.com/a/21098951/3419103). Or am I missing something?
That link states "text/javascript" is obsolete. |
Nevermind, it might not be. This RFC confused me https://tools.ietf.org/html/rfc4329 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just moved the fix to nicegui.py and added a pytest.
@thetableman, @natankeddem, can you confirm that it still works on your machines?
I was never able to "break" a fresh windows 10 install. I tried adding the key/value to 2 locations per the reports I saw. Perhaps there is more to change but unless @thetableman can't verify i'll pass on digging in further on that.
|
Moving There's a lot of conflicting information about which to use but Mozilla, which nicegui references in other places as a primary source, reads here https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textjavascript that |
Great, thanks @thetableman! |
This PR aims to resolve the
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain".
error with elements usingdynamic_properties.js
, examples of this error are noted in #1510 and #1579.Credit to @natankeddem for finding and suggesting the fix in #1579.