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

197
Views
applyMiddleware funciona solo si el archivo es commenJS, no funciona en el archivo ES6

Estoy tratando de usar applyMiddleware de redux pero cuando edito el archivo package.json

(agregando => "type" : "module" ) para usar ES6 para importar applyMiddleware de la siguiente manera

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

tengo ese ERROR

 \node_modules\redux\lib\redux.js:671 return middleware(middlewareAPI); ^ TypeError: middleware is not a function

pero cuando elimino ( "type" : "module" ) del archivo package.json e importo applyMiddleware de la siguiente manera

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

funciona bien. por qué applyMiddleware funciona solo con commenJS y cómo hacer que funcione con el módulo de tipo.

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!