#messy code

14 messages · Page 1 of 1 (latest)

twilit tangle
#

this is the error message it gives me

#

if anyone wouldlook into it, thanks :D

dry merlin
#

!!js.undefined

fair spindleBOT
#
Are you getting an error that looks like this?
💠💠💠

Uncaught TypeError: Cannot read properties of undefined (reading 'name') (or a very similar message)

This means you have tried to access a property on a value that is undefined. A value could be undefined (or null) for many reasons.

// Using a variable without declaring it:
foo.name;

// Declaring a variable, but not setting a value:
let foo;
foo.name;

// Declaring a variable, but setting it to undefined explicitly...
// or returning undefined from a function or method:
let foo = undefined;
foo.name

You'll have to find the variable on which you try to access the property, and work backwards to find out why it's undefined (or null). Errors come with stack traces right underneath. It will say the exact line and position where the error occurred.

twilit tangle
#

i mean if anyone could maybe fix it?

dry merlin
twilit tangle
#

okay

subtle coral
#

my guess is the clear method needs a null check, but yeah a sourcebin or something would be nice.

twilit tangle
#

eco

#

im still trying to see how i can fix the code

fair spindleBOT
#
Are you getting an error that looks like this?
💠💠💠

Uncaught TypeError: Cannot read properties of undefined (reading 'name') (or a very similar message)

This means you have tried to access a property on a value that is undefined. A value could be undefined (or null) for many reasons.

// Using a variable without declaring it:
foo.name;

// Declaring a variable, but not setting a value:
let foo;
foo.name;

// Declaring a variable, but setting it to undefined explicitly...
// or returning undefined from a function or method:
let foo = undefined;
foo.name

You'll have to find the variable on which you try to access the property, and work backwards to find out why it's undefined (or null). Errors come with stack traces right underneath. It will say the exact line and position where the error occurred.

twilit tangle
dry merlin