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

316
Views
Javascript me da un error de referencia no detectado: el requisito no está definido error

Tengo una estructura de archivos que se ve así: ingrese la descripción de la imagen aquí

Mi index.js tiene este código

 const THREE = require("three") var scene = new THREE.scene(); console.log(scene)

Mi index.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="webgl-output">What the hell</div> <script src="./index.js"></script> </body> </html>

No utilicé la etiqueta { type : "modules } en mi paquete.json. Sin embargo, sigo recibiendo el Error de referencia no detectada: el error require no está definido. ¿Puedo saber cuál es el motivo? ¡Gracias!

El error en mi servidor en vivo se ve así ingrese la descripción de la imagen aquí

Este es mi paquete.json si está interesado

 { "name": "threejs-playground", "version": "1.0.0", "description": "", "main": "src/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "three": "^0.133.1" } }
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!