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

226
Views
¿Por qué require() me da un indefinido?

¿Por qué require.js me da un indefinido?

Intento usar require.js y creo un archivo de carga usando data-main = "load" en html, aquí está load.js:

 requirejs(["script/app.js"]);

y en app.js, cuando intenté cargar el método, no pude leer la propiedad de indefinido, así que consola.log (ingresar) y recibí indefinido

 define(function(require) { var enter = require("./modules"); console.log(enter); // shows 'undefined' });

y este es módulos.js:

 define("post", ["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.post = void 0; function post(message) { console.log("! Message: " + message); } exports.post = post; }); define("main", ["require", "exports", "post"], function (require, exports, post_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.entry = void 0; function entry() { (0, post_1.post)("Hello, World!"); } exports.entry = entry; });

pero los módulos.js existen, el valor de 'enter' no debe estar indefinido. ¿Que pasa?

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!