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

368
Views
TypeError: no se puede establecer la propiedad '_toast' de indefinido

entonces, estaba usando el paquete express-toastr en mi aplicación. Siempre que trato de ejecutar el programa me da este error

 C:\Users\Johaa Jnr\Desktop\loginApp\node_modules\express- toastr\index.js:71 req._toasts = []; ^ TypeError: Cannot set property '_toasts' of undefined

aquí está mi código app.js

 ... var session = require('express-session') var cookieParser = require('cookie-parser') var path = require('path') var cors = require('cors') var flash = require('connect-flash') var toastr = require('express-toastr') app.use(express.static(path.join(__dirname, 'public'))) app.use(express.urlencoded({ extended: false })) app.use(cookieParser()) app.use(express.json()) app.use(session({ secret: 'keyboard cat', resave: false, saveUninitialized: false, cookie: { secure: false } })) app.use(flash()) app.use(toastr()) ...

y aquí está mi ruta

 Router.get('/', csrfProtect, (req,res)=>{ var qry = req.query.q if(qry){ req.toastr.error(qry) } res.render('signup', { req: req, csrfToken: req.csrfToken() }) })

No tengo la idea de lo que estoy haciendo mal aquí? Alguna solución a este problema ?

about 4 years ago · Santiago Trujillo
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!