Python Flask Mimetype Javascript module : blocked because of a disallowed MIME type (“text/html”)

Viewed 404

The server seems to be blocking my javascript module import ("cookieJs.mjs") because "of a dissallowed MIME Type ("text/html")"

I tried (First method):

<script type="module">

import { setCookie, getCookie } from './cookieJs.mjs'

</script>

And i also tried (Second method) :

<script type="text/javascript">

import { setCookie, getCookie } from './cookieJs.mjs'

</script>

The error now is "import declarations may only appear at top level of a module "

I'm using NginX as a reverse proxy : Tutorial flask uwsgi production

I'll use whatever method works.

Thanks in advance,

Sydney R

0 Answers
Related