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
applyMiddleware works only if the file is commenJS , not working in ES6 file

Iam trying to use applyMiddleware from redux but when I edit package.json file

( adding => "type" : "module" ) to use ES6 to import applyMiddleware as following

import { createStore, applyMiddleware } from "redux";,

I have that ERROR

\node_modules\redux\lib\redux.js:671
        return middleware(middlewareAPI);
               ^

TypeError: middleware is not a function

but when I remove ( "type" : "module" ) from package.json file and import applyMiddleware as following

const redux = require("redux");
const createStore = redux.createStore;
const applyMiddleware = redux.applyMiddleware;

it works fine. why applyMiddleware works only with commenJS and how to make it works with type module.

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