Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

375
Visualizações
JAVASCRIPT Modules Access-Control-Allow-Origin Error in Safari

I am not exactly new to javascript but I keep encountering errors when I try to use modules. Here is a snapshot of my html:

<script type= "module" src="scopes.js"></script>
<script type="module" src = "testImport.js" ></script>

Essentially, what I am trying to do is export class in scopes.js as default and then import it in testImport.js. The javascript snapshots:

1.

   constructor(src, type) {
       this.src = src;
       this.type = type;
      this.img = document.createElement('img');
   } 
   ///more stuff below of course
import {Scope} from './scopes.js'

When I try to run my html file, I get the errors:

[Error] Origin null is not allowed by Access-Control-Allow-Origin. [Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. (scopes.js)

I know this has something to do with security and the browser but I am really stuck on this because I thought safari supports modules. I am using safari 15.2.

Thank you in advance to everyone that reads this and answers!

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda