const contentType = {
".html": "text/html",
".js": "text/javascript",
".css": "text/css",
".ttf": "font/ttf",
".jpg": "image/jpeg",
".png": "image/png",
".gif": "image/gif",
};
fs.readFile(filePath, "utf8", (err, content) => {
if (err) {
res.writeHead(500, { "Content-Type": "text/plain" });
res.end("Internal Server Error");
console.error(err);
return;
}
res.writeHead(200, { "Content-Type": contentType[extname] || "text/plain" });
res.end(content);
});
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec
site.webmanifest:1 Manifest: Line: 1, column: 1, Syntax error.