import { cards } from './cards.js'
window.onload = () => {
let animacards = new cards();
document.addEventListener("scroll", animacards.teste )
}
class cards {
constructor() {
}
teste() {
console.log("scroll")
}
}
export { cards }
<script type="module" src="script.js" > </script>
ao tentar interligar o arquivo "index.html" ao arquivo "script.js" que tem importado a classe "cards" do arquivo "cards.js" o seguinte erro aparece no console: index.html:1 Access to script at 'file:///C:/Users/rodri/Desktop/0SVG%20SITE/script.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. index.html:1929 GET file:///C:/Users/rodri/Desktop/0SVG%20SITE/script.js net::ERR_FAILED