mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
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:
@@ -18,8 +18,13 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
import mimetypes
|
||||||
from flask import Flask, send_from_directory, send_file
|
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__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user