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

216
Vistas
Error using underscore and webpack together

I have an older webapp that uses React but also some older libraries. I am using Webpack 5 to bundle my files.

When I start the app, I get this error:

Uncaught TypeError: underscore__WEBPACK_IMPORTED_MODULE_1__.default.noConflict is not a function

Its on this line in the EntryPoint.js file:

var  underscore = _.noConflict();

And it's used like this:

import _ from 'underscore';
import Backbone from 'backbone';
import $ from 'jquery';

$.noConflict(true);
Backbone.noConflict();

// error here
var  underscore = _.noConflict();

underscore.templateSettings = {
    interpolate: /\{\{(.+?)\}\}/g, 
    evaluate: /\{%([\s\S]+?)%\}
};

I also tried this:

import underscore from 'underscore';
import Backbone from 'backbone';
import $ from 'jquery';

$.noConflict(true);
Backbone.noConflict();

// error here
underscore.noConflict();

underscore.templateSettings = {
    interpolate: /\{\{(.+?)\}\}/g, 
    evaluate: /\{%([\s\S]+?)%\}
};

I believe i am using it correctly based on the underscore docs:

https://underscorejs.org/#noConflict

Does anyone know what could be causing this?

Thanks!

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