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

254
Vistas
Cannot set property 'esprima' of undefined at webpackUniversalModuleDefinition

I'm receiving this error:

Uncaught TypeError: Cannot set property 'esprima' of undefined at webpackUniversalModuleDefinition (esprima.js:11) at esprima.js:12

When trying to load a web app:

Screenshot

The error happens here:

(function webpackUniversalModuleDefinition(root, factory) {
/* istanbul ignore next */
    if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if(typeof define === 'function' && define.amd)
        define([], factory);
/* istanbul ignore next */
    else if(typeof exports === 'object')
        exports["esprima"] = factory();
    else
        root["esprima"] = factory(); // ** => error is thrown here
})(this, function() {

// ...

});

For reference, the file webpack.config.js is:

// webpack.config.js
module.exports = {
    entry: {
        // import: './src/Three.js'
    },
    mode: 'production',
    output: {
        path: __dirname,
        publicPath: '/',
        filename: './build/three.min.js'
    },
    devServer: {
        watchContentBase: true,
        publicPath: "/",
        contentBase: "./",
        hot: true,
        port: 9090,
    },
};

Can anyone provide a clue what might be wrong?

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

0

The error is resolved by using WebPack script-loader which loads as simple script rather than module:

https://v4.webpack.js.org/loaders/script-loader/

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