Failed to load module script of type (.mjs)

28 Views Asked by At

I'm trying to integrate remark42 in my next js app but was unable to do so.

enter image description here

here is my configuration

`<script
dangerouslySetInnerHTML={{
__html:  var remark_config = { host: 'http://localhost:8080', site_id: 'remark', components:['embed'] }
}}
></script>
<script
   dangerouslySetInnerHTML={{
   __html:  !function (e, n) { for (var o = 0; o < e.length; o++) { var r =        n.createElement("script"), c = ".js",  // Update the file extension to ".mjs" d = n.head || n.body;   "noModule" in r ? (r.type = "module") : (r.async = !0), (r.defer = !0), (r.src = remark_config.host + "/web/" + e[o] + c), d.appendChild(r); } }(remark_config.components || ["embed"], document);,
  }}
></script>

I'm trying embed comment engine in my next js app I m runing the binary remark42 in my localhost,

all the configartions are ok but browser keeps giving MIME type error, any suggestion how should I resolve this issue.

0

There are 0 best solutions below