kanersps / essentialmode

A FiveM project
https://docs.kanersps.pw/docs/essentialmode
GNU Affero General Public License v3.0
82 stars 99 forks source link

Already made scripts are not tuned to run on version 6.4.2 #101

Closed bilbodog closed 3 years ago

bilbodog commented 3 years ago

Ever since we updated to 6.4.2, then most of our ESX resources starts complaining about functions errors referring the whole way back to ES. Also basically all the normal ESX resources such as:

And the list keeps going on. To fix the initial load problem, you will have to insert the while ESX=NIL then wait for giving the script time to load ESX and then work with the framework.

These scripts have difficulties in the beginning when people are joining and they are supposed to load the blips and initial things, then it will fail to gather the ESX framework because it says the ESX is NIL, which is some scripts cases causes the script to totally crash and being unfunctional.

This happened to all our scripts after updating to ES 6.4.2 and if downgrade none of this happens. We have fixed a lot of these, but I guess something must have been changed in order to screw with most of the scripts.

Furthermore, there are also functions reporting errors that I have never seen before we updated to ES 6.4.2. It is like the whole ES working together with ESX has gone very slowly which is causing some scripts to break on initial load because this update have caused the framework to load slower. Just a weak conspiration theory.

Best regards

Nikwitz commented 3 years ago

We are experiencing the same problems as bilbodog on my server. Anyone got some suggestions?

bilbodog commented 3 years ago

We are experiencing the same problems as bilbodog on my server. Anyone got some suggestions?

Nikwitz, if you downgrade to 6.2.2, it seems to be more "stable" or whatever has been done, was not done in that version. When we downgrade to this version, none of these things happens anymore.

It could be a temporary solution for you, at least on your LIVE server. But we are running a dev server where we are trying to fix all of these things because we want to have the latest version. I made this issue because I don't think this is the meaning of the updates. Because if the scripts load slowly enough for them to break, maybe the performance has been hit.

And the dev of the core framework can't do anything, if none of the users informs the people.

RockySouthpaw commented 3 years ago

So from my testing a week or two ago, this is the version that first started the errors pertaining to player loading and this commit is the last version without throwing any errors for old ESX (1.1).

Example error: Here Line: ESX.PlayerData = xPlayer Full Event:

AddEventHandler('esx:playerLoaded', function(xPlayer)
    ESX.PlayerData = xPlayer
    PlayerLoaded = true
end)

Artifacts: 2539 (I've also tried latest too.) ESX Version: 1.1 just before the ES ditch. These errors don't occur on ExM or an earlier version of essentialmode as mentioned above so it's not an issue with how the code is being written.

The errors it throws are usually just harmless though and will vanish once you restart the resource. However, they could be hiding an actual error eventually. I've seen the error on several resources tbh but they have always had 0 effect on me. I only have 150 resources on my server though and a max of 2 people so I’m not sure if the issue gets exasperated if you have more resources/more players. It's interesting though that your esx is having this many issues from just updating.

The solution is indeed to to downgrade essentialmode to the version I linked above.

bilbodog commented 3 years ago

So from my testing a week or two ago, this is the version that first started the errors pertaining to player loading and this commit is the last version without throwing any errors for old ESX (1.1).

Example error: Here Line: ESX.PlayerData = xPlayer Full Event:

AddEventHandler('esx:playerLoaded', function(xPlayer)
  ESX.PlayerData = xPlayer
  PlayerLoaded = true
end)

Artifacts: 2539 (I've also tried latest too.) ESX Version: 1.1 just before the ES ditch. These errors don't occur on ExM or an earlier version of essentialmode as mentioned above so it's not an issue with how the code is being written.

The errors it throws are usually just harmless though and will vanish once you restart the resource. However, they could be hiding an actual error eventually. I've seen the error on several resources tbh but they have always had 0 effect on me. I only have 150 resources on my server though and a max of 2 people so I’m not sure if the issue gets exasperated if you have more resources/more players. It's interesting though that your esx is having this many issues from just updating.

The solution is indeed to to downgrade essentialmode to the version I linked above.

Hmm, sounds weird since an older version fixes these errors. "Usually harmless" is a dangerous word when you try to count on stability. We have experienced that if you restart the script then it works, yes, but still, every player that joins after the restart will experience the errors as well, which mean that you will have to keep restarting the resources every time a new player joins the server and that is an impossible job.

And it can be discussed that the scripts are maybe poorly coded since they haven't taken into consideration that this could happen. Because 90% of all ESX scripts are counting on that they are able to call the ESX almost instantly and this is now causing problems with the scripts to place blips on the map, getting players jobs and other ESX info, since the ESX isn't loaded in time to get accessed.

I have tried to run both of the ES versions these combinations on Linux artefacts 2907, 2669, 2797, and the outcome is the same.

Best regards

Tinky124 commented 3 years ago

Still not fixed by @kanersps ??

bilbodog commented 3 years ago

Still not fixed by @kanersps ??

They are working on ESX V2 and it seems that the latest V1 series is no longer supported, so you are now forced to recode all of your ESX scripts into the now ESX V2 framework or fix the problems on your own, sadly.

Best regards

kanersps commented 3 years ago

Actually V1 is considered generally better, this is actually more of a problem with how your custom addons are written.

A possible alternative that has a higher chance of working is ExM.