When I try to load local images into my web project, I am getting the error
Access to XMLHttpRequest at 'file:///C:myFilePathHere' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
I'm getting a cors error when requesting images/files that are in the same file path as the index.html file when I try to just open the html file on my browser. However, I don't get this error when using a webpage preview on visual studio code.
If you try to access file from "file:///" you are doing a request in another domain, not "http://localhost". I suggest you to access a file from a standard url in http or https.
You can try to run your server using --allow-file-access-from-files like this example
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files index.html