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

113
Views
identifying javascripy modules in html

I have several JavaScript modules structured as shown below:

modules/
  main.js
  canvas.js
  shapes.js
  shapes/
    circle.js
    square.js
    triangle.js 

is main.js, canvas and shapes are imported. in shapes, circle,tringle, square modules are imported. I add a reference to main module in my HTML page like

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

but it has this error: Uncaught SyntaxError: Cannot use import statement outside a module.

can you help me? and can i don not add reference to child modules in html? for example I just add:

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

in HTML and not identifying other modules in HTML.

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