Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda