ReferenceError: fetch is not defined

fetch is a native javascript function, but when I try to create a script to send a webhook to discord using fetch, fivem returns this error.


other

it isn’t, fetch is a function provided by browsers or Node.js, the runtime on the client is neither a browser nor Node.js.

also, if you’re trying to use a ‘discord webhook’ on a client side script please don’t as that’s just extremely insecure as anyone with access to the ID can edit or delete your webhook and use server events instead