Help, I dont know whats causing this error!

I was given an error that Refuses to tell me where in my code is broken, as it claims the issue is in a file I dont have, and is “Null”.

https://replit.com/@Banesr18/Rocket-Bird#script.js

Does anyone know whats causing it?

When does the error occur?
Maybe try to add some console.log statements so you can have the full debug of your code.

For example, when you initialize your variables:

constructor(x, y) {
    // rest of your code
    console.log("Bird initialized", this.x, this.y, this.gravity, this.velocity, this.lift);
}

And your update method

update() {
    console.log("Updating bird", this.x, this.y, this.velocity);
    // rest of your code again
}

Go by each session that you think it might be giving you an error and add a console.log statement there. Also, remember to check your browser’s developer console (if you are using chrome you can access with F12) to see the output of these logs.

You don’t have to care about this error. It says that Replit’s Webview debugger had an error, which I don’t know how to fix. This wouldn’t impact your code running.

I wish this was true, but my code refuses to work when I try to run, and this is the only error provided to me.

Ignore my previous response, I found what was causing it. I forgot to but some variables into a stroke command, so it was trying to create a color without any values.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.