I’m running into an error when trying to attach a model in HOOPS Web Viewer:
Uncaught (in promise) yd: Missing model: ‘TS051.scs’
at _attached (hoops-web-viewer.mjs:43847:1)
at Mv.unsafeTrigger (hoops-web-viewer.mjs:9245:1)
...
From what I understand, the viewer is not able to locate the TS051.scs file.
Here’s what I’ve already checked:
Model is present on server in a folder from where SC server is searching for the models.
You cannot load an SCS file in an SSR session as this type of session requires a SC/SCZ file. If you want to load an SCS file, you will need to switch to CSR and use endpointUri, for example:
If the second else statement handles loading the SCS, your code is actually hitting the first else statement because defaultModel is true. In this clause, the WebViewer configuration is set up to load an SC/SCZ file not an SCS.
For the second else, let’s try something like this to load an SCS:
} else {
viewer = new WebViewer({
containerId: divId,
endpointUri: model?.modelName,
rendererType: rendererType //Needs to be CSR not SSR
});
It’s unclear to me what “…as well as TS051.scz model” means – given that the modelName to load TS051.scs? It sounds like you have logic to try load an SCZ even if the model is SCS?
I want to say that in below code I set modelName TS051.scs to load that scs model. but its giving error that missing model TS051.scs even if that model is present in the folder. So then I just replaced the TS051.scs model with TS051.scz model in that folder and changed the modelName to TS051.scz its get loaded into the viewer.
viewer = new WebViewer({
containerId: divId,
endpointUri: model?.modelName,
rendererType: rendererType //Needs to be CSR not SSR
});
but in CSR mode scs models should be able to load no? Instead scz models are loading in CSR mode properly.
In SSR Mode - Viewer getting feeze even I try to load scz models
SCS files, because they are file-based, are in different directory folders than Stream Cache. These folders are managed by fileServerStaticDirs in the server configuration file. Please see HOOPS_Communicator_2025.X.x\quick_start\server_config.js for an example.
You can try creating the WebViewer configuration based on whether the model file is SCS or SC/SCZ. Below is a code snippet:
The modelName does not have to be the full path. If the SCS is in a subfolder, it can be something like:
endpointUri: "data/myModel.scs"
SSR and CSR is controlled by rendererType: rendererType. SSR should work too in the else statement because the WebViewer config will be the same for both SSR and CSR.