Skip to content

instance_errors is all NaN in threejs library #176

@matthewhilton

Description

@matthewhilton

Ran this locally with Threejs / React Three Fiber

I found that it was loading every single piece, and then never doing anything else. Additionally the instance_errors attribute was entirely NaN (except for the last which was zero)

After debugging this, I tracked it down to the viewport variable - It was coming in as a object {x,y,z,w} meaning indexing using numbers was returning NaN,

for(let i = 0; i < 4; i++)
t.viewport[i] = viewport[i];

If replaced with this:

for(let i = 0; i < 4; i++) {
    t.viewport[i] = Object.values(viewport)[i];
}

The instance_errors is correctly populated and the loading now works again.

I'm using a slightly newer version of Threejs, 0.183.2 (0.181 is mentioned in the readme) but I doubt this would have changed as it would have been a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions