whatwg / fetch

Fetch Standard
https://fetch.spec.whatwg.org/
Other
2.12k stars 333 forks source link

CORB Problem #1666

Closed NoriFe closed 1 year ago

NoriFe commented 1 year ago

Hi guys having a problem with my website which I would like to upload to GitHub, I managed to make sure it will fetch files as .js .css etc but now CORB is in action and I cant go round it... any advice?

that the error: Cross-Origin Read Blocking (CORB) blocked cross-origin response https://raw.githubusercontent.com/NoriFe/Portfolio/main/index.js with MIME type text/plain. See https://www.chromestatus.com/feature/5629709824032768 for more details.

my js file: const mime = require('mime'); const http = require('http'); const fs = require('fs');

http.createServer((req, res) => { const filePath = 'index.js'; const mimeType = mime.getType(filePath);

res.setHeader('Content-Type', mimeType);

fs.readFile(filePath, (err, data) => { if (err) { // Handle error res.statusCode = 500; res.end('Internal Server Error'); return; }

res.statusCode = 200;
res.end(data);

}); }).listen(3000, () => { console.log('Server is running on port 3000'); });

annevk commented 1 year ago

In principle this shouldn't result in a CORB block so this might be an issue with Chromium, but you also haven't provided a lot of details. What is requesting this resource and from where?

NoriFe commented 1 year ago

Thank you I have sorted it. Was the wrong path. Thank you for your time annevk