'How to fix the CORS and unblock the load of my JS File?

I'm new to JS Web and I wanted to add import import { hash } from "crypto"; but I get an error telling me this:

Access to script at 'js file here' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, brave, chrome-untrusted, https.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source