Fix error loading ifctester webapp (infinite "initialize environment...")

Browser was stuck trying to initialize the environment, because of the error below:
[worker] Received message: {type: 'init', payload: {…}, id: '9dLz/0eBQDa0xTQORXfdUg/0'} :5000/pyodide/pyodide.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.
This commit is contained in:
Andrej730
2025-09-11 18:02:09 +05:00
parent ce4ad3c3a7
commit 5b96df89ea
+5
View File
@@ -18,8 +18,13 @@
import os
import argparse
import mimetypes
from flask import Flask, send_from_directory, send_file
# Browsers expecting this specific MIME type for .mjs files,
# otherwise they fail to load.
mimetypes.add_type("text/javascript", ".mjs")
app = Flask(__name__)