Missing model error when attaching in HOOPS Web Viewer

Hi Team,

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.

Still, the viewer throws this error.

Could you please guide me on this.

Thanks in advance for your support!

Hello,

Can you please share the specific functions you are calling to load the model?

Thanks,
Tino

if (rendererType === RendererType.Server) {
console.log(‘server’);
viewer = new WebViewer({
containerId: divId,
endpointUri,
model: model?.modelName,
rendererType: rendererType,
});
} else if (defaultModel) {
console.log('data - ', endpointUri, model, rendererType, defaultModel);
viewer = new WebViewer({
containerId: divId,
endpointUri,
model: model?.modelName,
rendererType: rendererType,
});
} else {
viewer = new WebViewer({
containerId: divId,
empty: true,
});
}

Running in SSR mode in second if else

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:

endpointUri: 'TS051.scs',

And remove modelName.

second block of else if is SCS session and i am loading scs files TS051.

this is enpointUri using internal routing by spawnId - ws://localhost:8082/ca04f475-0786-4b4c-9071-5b7ba203cc6a

and modelName is “TS051.scs”

Is your code based off of one of our projects/sandboxes? If so, can you tell me which one?

No. This is our client project.

The error i am getting is viewer specific or sc server specific?

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
});

As a test, force defaulModel to false.

I Tested multiple times with combinations to load models into the viewer what I observed is that -

  1. In CSR mode -
    1. when modelName set to TS051.scs - the TS051.scs model as well as TS051.scz model both throws “Missing Model TS051.scs”
    2. when modelName set to TS051.scz - the TS051.scs model throws “Missing Model TS051.scz” but the TS051.scz loads perfectly
  2. In SSR mode - No matter what you set viewer always gets freeze before loading the model

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?

Lets make it simple.

In SSR Mode -

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

I have a couple of suggestions:

  • 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:
if (model?.modelName?.endsWith('.scs')) {
  console.log('SCS');
  viewer = new WebViewer({
    containerId: divId,
    endpointUri: modelName
  });
} else {
  console.log('data - ', endpointUri, model, rendererType, defaultModel);
  viewer = new WebViewer({
    containerId: divId,
    endpointUri: endpoint,
    model: model?.modelName,
    rendererType: rendererType,
  });
}

Is modelName full path to the scs model present on server in if block? So, no server-side rendering?

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.

I am confused about the required file types for different modes in HOOPS Communicator.

There are three modes of operation:

  1. CSR – Client-Side Rendering with streaming from the server

  2. SSR – Server-Side Rendering with streaming from the server

  3. SCS file rendering – Directly loading the whole .scs file in the browser (no server involved)

My questions are:

  • In CSR mode, which file type is required: .scs or .scz?

  • In SSR mode, which file type is required: .scs or .scz?

Also, in our setup:

  • We use a Node.js SC Server with a proxy.

  • The viewer connects via WebSocket:

    endpointUri: "ws://localhost:8082:spawnId",
    modelName: "mymodel.scz"
    
    

    → This streams the .scz file from the server.

But how would it work if we want to load only .scs files using just the endpointUri without specifying modelName? For example:

endpointUri: "data/myModel.scs"

Note:

  • Currently, only .scz files are getting streamed in CSR mode.

  • .scz might also work in SSR mode, but the viewer is currently freezing (possibly a GPU issue).

Please see this section on the Web Viewer configuration in our docs for more details:

Regarding your questions and comments:

  • SCS file is CSR only. Regular Stream Cache and Stream Cache zip (SCZ) are CSR and SSR.
  • SCS is file-based and is loaded via HTTP request not WebSocket. Please see the loading section in our docs.

Does the model load in the viewer and freezes or the model doesn’t load at all?

Model doesnt load at all

You can try looking at the Communicator logs — the location of which is specified in the server configuration file. Using my system as an example, the default directory for the Communicator package is placed in C:\Users\tino.perez\ts3d_communicator_logs

Compare the logs generated by CSR and SSR and see if there are any differences. The names of the .log files are prefixed by:

comm_scserver_ssr* and comm_scserver_csr*