Before posting i have read something about this bug, posts about months ago, so i try again, because there's no solution.
Randomly the game crash with this error:
Uncaught TypeError: "Cannot read property "width" of null"
After doing some research, it seems this is a known issue with RPG Maker MV caused by the method of screen flickering used in our game (rapidly displaying/erasing a picture with 1 frame of waiting in between).
I have removed the (1 frame) in my game, i use that for a custom menù like Zelda made by pictures for cursors and items.
My Rpg_Core.js is 1.2.0, because with the uptades to 1.3.1 i have Some Screen Flickering glitches, with black tiles on the border when the game create the map.
So my question is:
Is this bug fixed in 1.3.1 (i that case i focus to find out how to fix screen flickering)
Or there's a known sloution for the 1.2.0?
Best
BUG "Cannot read property "width" of null"
● ARCHIVED · READ-ONLY
-
-
you're wrong in several points.
This is not "A" bug, it is a type of bug that has dozens of variants. And there always has been a solution, but because this is not a single bug (and it is NOT cause by the engine but by the project), the solution has other details depending on which project and developer it is.
Basically, there are four different causes that can result in a message like this. The fourth is a special case depending on the exact error message (I can't tell because you didn't give a screenshot of the console output of that message)
1) you tried to play with an incompatible saved game - please try if that error happens if you started a new game instead of continuing a saved file
If you add a new plugin, in 80% of all cases that plugin needs to be initialized with a new game. If you continue a saved file, sooner or later you'll get to the point where the new plugin tries to access data that has not been initialized (that is the NULL) and cause an error.
The solution is simply to start a new game.
2) you installed a combination of plugin that is incompatible or in the wrong order
Basically that may also cause some initializations to fail, again resulting in the NULL-Object, only that in this case a new game is not enough to solve the problem - you need to disable your plugins one after another, each time starting a new game, until the error no longer happens - then you'll know that the last plugin disabled is part of the cause.
Here a screenshot of the console would help as it lists the names of involved plugins.
(this can especially happen if the plugin in question is no longer compatible to the core used - there are several cases where plugins written for 1.0 are incompatible with those written for 1.2 or 1.3 (and some plugins for 1.2 are incompatible with 1.3)
3) Some data (plugin or database) points to non-existing entries
It's most likely a wrong plugin configuration, because the only way it could happen with the database is if you delete entries by reducing the maximum ID. If you never did that, it can only be a plugin property pointing to an entry that does not exist.
4) Event Picture commands have been mixed up
There are several event commands for manipulating pictures, and they all are linked by picture ID.
However, if a picture is erased by event command and then after that another event command tries to access the erased picture, then again a message like the one you gave can happen - because again, that is accessing an object that no longer exists and is now NULL.
This can happen especially if you use picture commands in parallel process events, and got into a timing problem that didn't switch off the later PPs in time.
Oh - and screen flickering is usually a problem caused by wrong parallel processes as well - so I suggest you really check the option 4 and find out where you made a mistake in your parallels that might have caused this. -
@Andar thank you i start to understand, maybe is the point 4 or maybe also the plugin Iavra Gif here the console log, what you think?

-
Sorry if this has already been resolved, but I get the same message only when I select Battle Test in the Troops menu. It works fine in game, and I've tried removing all plugins and adding them back in but to no solution. If anyone could help that would be great!
-
@squid
NO, you don't have the same bug - you have a different bug that causes the same type of message (as do hundreds of other bugs. So you need to make your own topic with your own details and screenshots.
Closing this