players.forEach is not a function
at eval (eval at compile (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:618:12), :28:16)
at returnedFn (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:653:17)
at tryHandleCache (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:251:36)
at View.exports.renderFile as engine
at View.render (C:\players\node-mysql-crud-app\node_modules\express\lib\view.js:135:8)
at tryRender (C:\players\node-mysql-crud-app\node_modules\express\lib\application.js:640:10)
at Function.render (C:\players\node-mysql-crud-app\node_modules\express\lib\application.js:592:3)
at ServerResponse.render (C:\players\node-mysql-crud-app\node_modules\express\lib\response.js:1016:7)
at Query.db.query (C:\players\node-mysql-crud-app\routes\index.js:10:17)
at Query. (C:\players\node-mysql-crud-app\node_modules\mysql\lib\Connection.js:525:10)
One of the things that you can check is in inside /routes/index.js
Make sure that the players: result is not in any quotes.
foreach is a function of arrays. If you have 'result', that is a string.
Hi, I have a problem:
TypeError: C:\players\node-mysql-crud-app\views\index.ejs:18
16|
players.forEach is not a function
at eval (eval at compile (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:618:12), :28:16)
at returnedFn (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:653:17)
at tryHandleCache (C:\players\node-mysql-crud-app\node_modules\ejs\lib\ejs.js:251:36)
at View.exports.renderFile as engine
at View.render (C:\players\node-mysql-crud-app\node_modules\express\lib\view.js:135:8)
at tryRender (C:\players\node-mysql-crud-app\node_modules\express\lib\application.js:640:10)
at Function.render (C:\players\node-mysql-crud-app\node_modules\express\lib\application.js:592:3)
at ServerResponse.render (C:\players\node-mysql-crud-app\node_modules\express\lib\response.js:1016:7)
at Query.db.query (C:\players\node-mysql-crud-app\routes\index.js:10:17)
at Query. (C:\players\node-mysql-crud-app\node_modules\mysql\lib\Connection.js:525:10)
How can I fix it?
BR,
Aleksandra
Can u tell us how did u manage to fix your issue?
I'm also stuck with the same error....
but ok, it was no question. it was just a stupid error in my index.ejs file. Now it works! :)
I am getting the same problem what u did?
Have you got a solution?
Any solution?
How did you fix it.please help..
One of the things that you can check is in inside /routes/index.js
Make sure that the players: result is not in any quotes.
foreach is a function of arrays. If you have 'result', that is a string.
hy i have same question online 18
how did you fix it
please help