moorhen-coot / Moorhen

A JavaScript molecular graphics program
https://moorhen.org
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

Error with CCP4Module when loading data #427

Open mgaonach opened 2 months ago

mgaonach commented 2 months ago

Hello,

I am getting an error when loading data into moorhen, please see screenshot bellow for trace.

This error seems to happen randomly. If it appears and I reload the page, it will not always appear again.

It happens when automatically loading data from a MTZ and PDB file URL using the methods defined here: https://gitlab.esrf.fr/icat/icat-edm-viewer/-/blob/main/src/moorhen/data.ts?ref_type=heads they are called from there: https://gitlab.esrf.fr/icat/icat-edm-viewer/-/blob/main/src/moorhen/MoorhenContainer.tsx?ref_type=heads

The error seems to happen when calling functions on window.CCP4Module which is undefined at the time of the error, but is defined when I log it into the console myself (see screenshot). This makes me think that I am probably calling the data loading methods too soon, sometimes before it is properly initialized. But I am using the cootInitialized state selector so I don't know why this happens.

Probably I am missing something, do you have any idea what?

Thanks for the help!

Full trace + CCP4Module log: moorhenlogs

First error: 1

Second error: 2

stuartjamesmcnicholas commented 1 month ago

Sorry, I have not been monitoring this forum recently. Many apologies, the person who used to look after it has left the project. I will look into this asap.