Loading error in Rhino3dm.js

Hi @fraguada,

I get this error with the rhino3dmjs loader with 8.0.1 update as shown in the image.
Have also attached the github repo link just in case.

Uncaught (in promise) TypeError: onError is not a function
at main.js:170239:18


That error means you haven’t defined an error function for your loader reference. There is an error, but the 3dmloader doesn’t know what to do with it because you haven’t defined an error function.

From looking at your repo, you have something like this:

loader.load( 'path/to/model.3dm', function ( object ) {

       //...
    
    } );

it should be something like this:

loader.load( 'path/to/model.3dm', function ( object ) {

       // onLoad: object has loaded, do something with it
    
    }, function( progress ) {

       // onProgress: do something with progress info if you want

    }, function( error ) {

       // onError: do something with error. Good idea to have this, cause there is an error and the loader doesn't know how to tell you.
    
    }  );
1 Like

Hi @fraguada @will

So I made the changes as you suggested and I got this error as attached.
Seems like a rhino3dm issue to me. Kindly guide me :sweat_smile:

1 Like

The code is still up at this repo if you’d like to check.

GitHub - keshavanarayan/Digital-Twin at debug 1

@fraguada bumping this up. Just in case :sweat_smile:

Hi @fraguada,

This is the error that I get. I’m guessing this is a rhino3dm issue.

doc.instanceDefinitions(…).count is not a function at decodeObjects

Do you have a sample file or data where this error shows up?