Error Cannot read Property ' toString ' of Undefined

Asked

Viewed 1,590 times

0

I am creating an application making use of Express, but I’m facing that mistake :

➜  Futiba git:(master) ✗ node index.js

➜ [ Server ] Online

/home/akira/Downloads/Futiba/node_modules/mysql2/lib/packets/execute.js:57

          var str = this.parameters[i].toString();
                                       ^

TypeError: Cannot read property 'toString' of undefined
    at Execute.toPacket (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/packets/execute.js:57:40)
    at Execute.start (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/commands/execute.js:53:40)
    at Execute.Command.execute (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/commands/command.js:40:20)
    at Connection.handlePacket (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/connection.js:515:28)
    at Connection.handlePacket (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/connection.js:521:12)
    at PacketParser.onPacket (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/connection.js:94:16)
    at PacketParser.executeStart (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/packet_parser.js:77:14)
    at Socket.<anonymous> (/home/akira/Downloads/Futiba/node_modules/mysql2/lib/connection.js:102:29)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
➜  Futiba git:(master) ✗

When trying to add values to inputs from localhost:3000/admin/games. I searched here in the forum, but most of the topics I found had in their logs information of where the error was, in this case it does not specifically inform and I’m not able to track even if I found something similar in Why do I get Cannot read Property ' toString ' of Undefined, but again, I’m not making use of toString and it wouldn’t be nice to edit that in the package Mysql 2 which I assume is making use of this function, or it would still be likely that the error is found in my application code ?

Obs : project Futiba on Github and when I call input ' save ' it sends me the following message

inserir a descrição da imagem aqui

  • 1

    Could you put a snippet (piece) of code for us to evaluate, please? Probably, this.parameters[i] does not exist (is Undefined) because the index i is out of the tamano range of this Parameters

  • This Feature is related to these two files : https://github.com/Sphinxs/Futiba/blob/master/admin.js#L41 and https://github.com/Sphinxs/Futiba/blob/master/views/admin/games.ejs#L95 ( Ps, I set anchor to go straight to the part of the code that I think the error is in )

  • 1

    I checked the codes, the error could be in game.game_id or in Guess.id. One of these 2 items is returning Undefined. Try debugging these variables.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.