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

189
Views
Javascript Module Import and Export not Working (Importing binding name is not found.)

I've scoured SO and the Web for answers, but have found nothing so far that has helped. When navigating to my test site (see below), I'm getting this error: Importing binding name 'Person' is not found.

From index.html:

<script type="module" src="js/person.js"></script>
<script type="module" src="js/script.js"></script>

From script.js:

import {Person} from '/js/person.js';

From person.js:

export class Person {
  constructor(
    firstName, lastName, email
  ){
    this.firstName = firstName;
    this.lastName = lastName;
    this.email = email;
  }

  setFirstName(firstName){
    this.firstName = firstName;
  }

  setLastName(lastName){
    this.lastName = lastName;
  }

  setEmail(email){
    this.email = email;
  }

}

All the documentation I've found appears to indicate that I'm doing this correctly, and yet I get the error. Any ideas, anyone?

UPDATE Everything works fine under Windows, but not using MacOS 12 in Safari, Firefox, or Chrome. Why?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Issue resolved; I was using the 'Live Server' plugin in VS Code on MacOS to serve the site which apparently caused the problem (although under Windows, it works just fine). When serving it with Apache on MacOS, it works.

about 4 years ago · Juan Pablo Isaza Report
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!