Incorrect MimeType preventing javascript from loading on some machines
mikebru opened this issue · comments
Hey there!
I was testing on a few different computers and noticed that on some PCs Mediapipe wouldn't load.
From taking a look at the webpage I saw that this error was occurring,
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.
I went into the Mediapipe tox and added these lines of code in the mp_webserver_callbacks dat.
if fileName.endswith('.js'): mimeType = ['application/javascript'] else: mimeType = mimetypes.guess_type(fileName, strict=False)
This solved the issue for me and allowed the TOX to function correctly.
Great fix! Just published a new release that incorporates this :)
https://github.com/torinmb/mediapipe-touchdesigner/releases/tag/v0.2.2