OK, that is the routine that places the piece images in the already-created board table according to the current position. Since it cannot do that without knowing the value of ranks, I suppose the error causes an abort of the script execution. It sounds like there is a spurious extra call to the Display routine that is not part of the normal initialization of the Diagram. Which happens after a delay, to first give the entire page the opportunity to load. So it could happen at the time the script is read, while ranks is still uninitialized, the later initialization fixing everything.
OK, that is the routine that places the piece images in the already-created board table according to the current position. Since it cannot do that without knowing the value of ranks, I suppose the error causes an abort of the script execution. It sounds like there is a spurious extra call to the Display routine that is not part of the normal initialization of the Diagram. Which happens after a delay, to first give the entire page the opportunity to load. So it could happen at the time the script is read, while ranks is still uninitialized, the later initialization fixing everything.
On FireFox I have no such error message.