How to use ColladaLoader inside of a web worker?

I am trying to use a web worker to load models onto the scene. The other loaders are working fine but I am not able to use ColladaLoader. I am attaching a screenshot of the error.

Screenshot 2024-03-04 122303

Can someone help me to solve this? I am using this inside Next.js framework.

You’d need to modify the loader by copying its code and adjusting it to not use DOM API, since that API is not available in workers.


Okay, that is the final resort I think.