Pablo_Escobarza Posted November 16 Posted November 16 Hello, I have a server on localhost that I have been working on for some time, yesterday I uploaded it to a Linux host and everything works fine, except for a serverside package where I get an error. The package loads, but after the message "[DONE] The server is ready to accept connections." from console, i get crash with below error. TypeError: mp.vehicles.forEach is not a function at setVehPosition (/home/container/packages/s_music/index.js:14:17) at Timeout._onTimeout (/home/container/packages/s_music/index.js:3:24) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) The code: setInterval(function(){setVehPosition();},100); function setVehPosition() { mp.vehicles.forEach((veh) => { ...... Basically, I use an interval of 100ms, and the function is the one below, where I apply some variables to the vehicles. Why do I get this error? Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now