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

199
Vistas
Error: THREE is not defined inside FBXLoader

I'm using the module version of three.js because I need to run imports from a client-side js file structure.

THREE itself works fine. But now I'm having the issue that I cannot use it in FBXLoader:

This is the import statement on my client-side rendering file:

import * as THREE from '/build/three.module.js';
import * as FBXLoader from '/js/loaders/FBXLoader.js';

This does not throw any errors.

Server-side, I'm using express to allow access to modules on client-side:

app.use(express.static(__dirname + '/public'));
app.use('/build/', express.static(path.join(__dirname, 'node_modules/three/build')));
app.use('/js/', express.static(path.join(__dirname, 'node_modules/three/examples/js')));

So far so good.

When I try to run, I get the following error:

Uncaught ReferenceError: THREE is not defined
    <anonymous> http://localhost:3000/js/loaders/FBXLoader.js:22
    <anonymous> http://localhost:3000/js/loaders/FBXLoader.js:3817

Any ideas what the problem is? There error is not in my code, this is something inside FBXLoader.js.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A file's imports are scoped to that file. It may be that FBXLoader.js isn't importing THREE and that's why it's undefined. Include in FBXLoader.js:

import * as THREE from '/build/three.module.js';
about 4 years ago · Juan Pablo Isaza Denunciar
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