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

221
Views
Javascript doesn't recognize relative path imports

Image This is my projects structure in Webstorm

if I import Objects.js by this line it works

import * as Objects from "../../ecosystem/js/world/Objects.js";

but if I swtich to any of these

import * as Objects from "../js/world/Objects.js";
import * as Objects from "./js/world/Objects.js";
import * as Objects from "js/world/Objects.js";

It doesnt work and gives error GET http://localhost:63342/js/world/Objects.js net::ERR_ABORTED 404 (Not Found)

I suspect this is because the network request is Request URL: http://localhost:63342/js/world/Objects.js which lacks ecosystem folder. How can I solve this in a clean way?

I create classes and export them at the end of Objects.js file as follows.

I looked into these links but still couldn't solve my issue:

Import doesn't work when using relative path. JavaScript

How do I include a JavaScript file in another JavaScript file?

export {Sphere, LightIndicator, MouseFollower, Terrain, Box};

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!