Repository navigation
Failed to fetch dynamically imported module: http://127.0.0.1:50466/main.dart.mjs #5976
Unanswered
RezaErfani67
asked this question in
Q&A
Replies: 1 comment
|
This happens on Windows. Flet's web server gets the MIME type from Python's Fixes, pick one:
import mimetypes
mimetypes.add_type("text/javascript", ".mjs")
mimetypes.add_type("application/wasm", ".wasm")The web server runs in the same Python process as your script, so this should be enough (it's exactly what the 0.81 fix does), but I haven't tried it on a Windows machine with the broken registry entry. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Question
Version 0.8.1
code is run(main)
terminal ::
flet run --web main.py
console
main.dart.mjs:1 Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
127.0.0.1/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://127.0.0.1:50466/main.dart.mjs
Code sample
Error message
No response
------------------------------------------------------
All reactions