Lesson 32 : Unhandled Runtime Error ReferenceError: error is not defined
Opened this issue ยท 8 comments
Error when submitting the form in order to add the first ticket.
Unhandled Runtime Error
ReferenceError: error is not defined
Source
app(dashboard)\tickets\create\CreateForm.jsx (29:18) @ error
27 |
28 | if (json.error) {
29 | console.log(error.message)
| ^
30 | }
31 | if (json.data) {
32 | router.refresh()
I get the same error. Even cloned the code from that lesson, same error.
Same error here as well.
Same here guys
I had the same problem. In the 'tickets/route.js' file, I modified the table name from 'tickets' to 'Tickets' . That solved it.
I had the same problem. In the 'tickets/route.js' file, I modified the table name from 'tickets' to 'Tickets' . That solved it.
Holy moly it helps. I just saw that Shaun has named a table "tickets" and I named it "Tickets". That's so stupid. Thank you for your message. You nailed it!
I had the same problem. In the 'tickets/route.js' file, I modified the table name from 'tickets' to 'Tickets' . That solved it.
Thank you very much !
I had the same problem. In the 'tickets/route.js' file, I modified the table name from 'tickets' to 'Tickets' . That solved it.
This helped me as well, thanks!
Yes, renaming the supabase table to tickets
or using Tickets
in the route.js
file takes care of the error. However, if an error is encountered, like in this case, it is not handled properly. That is, error.message
is not defined as error
is not defined in the first place in the file. Therefore, this piece of code should be fixed:
if (json.error) {
console.log(error.message)
}
I also tried using json.error.message
instead but it prints undifined
in the console. I wonder how to read the error message that comes from supabase then.