So CORS stands for Cross Origin Resource Sharing and in order to use anything in JavaScript on the client side you must send the asset with a server that sets the correct CORS headers so that the code is allowed to consume it - else people could take content from any site and use it without permission which could lead to unintended consequences.
If the asset is on the same domain as the webpage you are hosting then this will not be an issue. However if the asset you are trying to bring in is on a different domain (eg subdomain too) then you must explicitly set these headers with your server configuration. You also need to set the “crossorigin” attribute on the HTML too for images etc:

  
      

      developer.mozilla.org
  

  
    

HTML attribute: crossorigin - HTML: HyperText Markup Language | MDN 1

  The crossorigin attribute, valid on the , , ,


  

  
    
    
  

  


More details on CORS can be found here:

  
      

      developer.mozilla.org
  

  
    

Cross-Origin Resource Sharing (CORS) - HTTP | MDN 1

  Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. CORS also relies on a mechanism by...


  

  
    
    
  

  


If you use a website like Glitch.com 1 to host your demo CORS headers are set automatically.
It should also be noted that you probably need to serve your assets over https too as mixed protocols eg some assets on http and some on https will also lead to issues.