Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

371
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!