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

308
Views
TypeError: no se pueden leer las propiedades de undefined (leyendo 'filas')

Intentando usar Express JS con la aplicación React y PostgreSQL DB por primera vez, estoy siguiendo este tutorial , pero editando ligeramente para mi necesidad (almacenamiento de recetas). Actualmente recibo este error y no estoy seguro de por qué...

 TypeError: Cannot read properties of undefined (reading 'rows') at /Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/recipe_model.js:16:23 at Query.callback (/Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg-pool/index.js:415:18) at Query.handleError (/Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg/lib/query.js:128:19) at Client._handleErrorMessage (/Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg/lib/client.js:335:17) at Connection.emit (node:events:526:28) at /Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg/lib/connection.js:114:12 at Parser.parse (/Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg-protocol/dist/parser.js:40:17) at Socket.<anonymous> (/Users/xx/Desktop/Programming/recipes/recipes/backend/node_postgres/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:526:28) at addChunk (node:internal/streams/readable:315:12)

El código relevante de recipe_model.js

 const getRecipe = () => { return new Promise(function (resolve, reject) { pool.query('SELECT * FROM recipes ORDER BY id ASC', (error, results) => { if (error) { reject(error) } resolve(results.rows) }) }) }

Gracias por cualquier ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su consulta está funcionando bien, pero las filas no existen en el resultado, resuelva solo el resultado y verifique con console.log lo que está obteniendo en el resultado .

Respóndeme en un comentario para cualquier consulta.

about 4 years ago · Juan Pablo Isaza Report
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!