From ecb656af70c54d1361926b5742a172dd56793aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clarey=20Sj=C3=B6strand?= <50966051+baptistecs@users.noreply.github.com> Date: Wed, 22 May 2024 00:04:00 +0200 Subject: [PATCH] Fix .js mimetype on Windows 11 Failed to load module script: Expected a JavaScript 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. --- backend/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/main.py b/backend/main.py index 4cf3243f7..e820ce528 100644 --- a/backend/main.py +++ b/backend/main.py @@ -8,6 +8,7 @@ import sys import logging import aiohttp import requests +import mimetypes from fastapi import FastAPI, Request, Depends, status from fastapi.staticfiles import StaticFiles @@ -408,6 +409,7 @@ app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static") app.mount("/cache", StaticFiles(directory=CACHE_DIR), name="cache") if os.path.exists(FRONTEND_BUILD_DIR): + mimetypes.add_type('text/javascript', '.js') app.mount( "/", SPAStaticFiles(directory=FRONTEND_BUILD_DIR, html=True),