Thanks, but I’m using my own proxy server. My proxy server is not working
Thanks as well, I’m aware that it means the proxy didn’t respond within a reasonable timeframe, but can I confidently assume that means there were no errors with my nodejs code and rather a permanent yield? When I attach a .catch to the fetch function that doesn’t fire any response back either so it must be hanging at the fetch call line. Any guesses on what might’ve gone wrong in that case?
Well form the js code you shown you are not sending back any status code response and that is causing the request to go through but roblox to think that you haven’t handled the request in time throwing error 504
Would u mind showing the full code of your proxy? I think I know what’s happening
Yep, exactly what I thought. Node.js doesn’t have the js fetch api. Instead you need to use node fetch in order to use fect in node
Fetch is not defined in Javascript, it is in the browser so to use fetch on backend you need to install node-fetch
The worst part is that it just returned a 504 gateway and no errors. I did have a catch statement for the fetch (I’m using axios instead now which works) but the catch didn’t fire the error response.
I had to run a nodemon local server to see the bug, which I suppose that’s what I was supposed to be doing the whole time(new to this lol)
Code?
Asumming you’re using a try catch block, you have to throw a new error when res fails. So that the catch block fires. Alternatively you can just remove the await from the axios request and add in a .catch() that’ll fix it to.
Nodemon doesn’t impact how errors are displayed, Nodemon is just a package to auto run a command after making changes to a file
Pretty much this. But I assume since fetch was never defined it just hangs there indefinitely? I never once got an error 400 returned to roblox studio. (Also assume the link in the lua script is my proxy)
The catch isn’t logging the error so that’s why. Add console.log(err)
It’s fairly hard to help with very vague code. Please paste ur full code here. You can edit out ur webhook url from the code.
It’ll make it a lot easier to help and find a fix quicker
That’s not what I meant, basically I just ran a localhost server to debug and see the console output
I have it working now with axios, I looked up why it wasn’t catching the ‘fetch not defined’ error and its because a promise was never created in the first place since the program errored before it could be created.
I appreciate the help!
Just to specify, “fetch is not defined” doesn’t occur because a promise isn’t created but because fetch doesn’t exist in node.js
Yep, the promise isn’t created as an effect of fetch not being defined.
Could you mark one of our posts as the solution? To help future readers?
I would recommend u mark this as the solution since it explains why u got this error in the first place
Just to clarify for why you might be getting a 504 gateway timeout instead of getting an error response - it’s because a promise was never created since in my case fetch was never defined. So the proxy server will stop functioning at that point and end up hanging the request.
Using ur own proxy server is definitely better, by the way. I just learned some cyber security aspect of networking , and I’ve changed all my discord webhook to my own proxy server.