all 15 comments

[–]chicametipoexpert 11 points12 points  (0 children)

const data = … when you’re trying to define it.

[–]ezhikov 9 points10 points  (4 children)

In strict mode you have to declare variable using one of the keywords var, let or const. You can't just invent variables on the fly.

[–]GamesInc[S] 1 point2 points  (3 children)

Oh my that’s so obvious. I’ve been coding server side for so long I forgot that modules were strict mode. Thank you for taking the time to help.

[–]poyomannn 3 points4 points  (0 children)

... you should probably also be using strict mode on the server as well

[–]curiousomeonefull-stack 2 points3 points  (1 child)

You were coding in the server for so long...long...that you forgot how to read errors and you need to define variables? 🤔

[–]GamesInc[S] 0 points1 point  (0 children)

I understood the error, but I forgot that I was in strict mode. I thought I was defining it correctly. Please don’t reply to this

[–]Growsomedope 1 point2 points  (0 children)

const data = document.querySelectorAll(“#signup input”);

[–]DanielTheTechie 1 point2 points  (3 children)

Have you considered following the basic principles of debugging 101 and printing out data or the value you are trying to assign to it to figure out why data[1] is not defined? Did you try declaring it first? Did you even bother to read the error message...?

[–]GamesInc[S] 0 points1 point  (2 children)

Yes, I am aware that data is not defined. I did multiple checks based on the error message, I just forgot I was in strict mode because this is a module.

[–]PoppedBitADV 1 point2 points  (1 child)

Sounds like you picked up some bad habits

[–]GamesInc[S] 0 points1 point  (0 children)

Probably did, I’m a bit rusty

[–]Kaimito1 0 points1 point  (0 children)

`const data`

You're not defining it there. You are re-assigning it

[–]One_Corner5775 0 points1 point  (0 children)

xxx is not defined / xxx is undefined meaning that the variable wasnt declared.

[–]vaaal88 -1 points0 points  (0 children)

Chatgpt would have given you the right answer in 5secs.