re: Build a simple app using Node JS and MySQL. VIEW POST

FULL DISCUSSION
 

Hi!
I get error after clicking 'Add a Player'. Here is the output:

ReferenceError: /home/corny/dev/node/node-msql-crud-app/views/add-player.ejs:7
5| <% } %>
6|

7| <% if (player) { %>
8|


9|
10|

player is not defined
at eval (eval at compile (/home/corny/dev/node/node-msql-crud-app/node_modules/ejs/lib/ejs.js:618:12), :34:8)
at returnedFn (/home/corny/dev/node/node-msql-crud-app/node_modules/ejs/lib/ejs.js:653:17)
at tryHandleCache (/home/corny/dev/node/node-msql-crud-app/node_modules/ejs/lib/ejs.js:251:36)
at View.exports.renderFile as engine
at View.render (/home/corny/dev/node/node-msql-crud-app/node_modules/express/lib/view.js:135:8)
at tryRender (/home/corny/dev/node/node-msql-crud-app/node_modules/express/lib/application.js:640:10)
at Function.render (/home/corny/dev/node/node-msql-crud-app/node_modules/express/lib/application.js:592:3)
at ServerResponse.render (/home/corny/dev/node/node-msql-crud-app/node_modules/express/lib/response.js:1008:7)
at addPlayerPage (/home/corny/dev/node/node-msql-crud-app/routes/player.js:5:13)
at Layer.handle as handle_request

================
Can you help me?

BR,
Corny

 

Hello, sorry about the error, kindly check the add-player.ejs and edit-player.ejs files to confirm everything checks out and then try again.

 

My god, I switched files contents... I am an idiot. Thank you for help and great tutorial.

BR,
Corny

code of conduct - report abuse