I am trying to think where we reference “self” in the viewer. self is usually the global variable in a webworker, and this could come from the loader or from parsing certain images. So - I am not sure what triggers the workers here, but this would be the first thing I would check.
Also, as @sebavan mentioned, the viewer will not pre-render while prerendering the page. You would need to place this code in a script that will be executed client-side.
I checked and this was used instead of self, but the self error keeps poping up, useEffect handled it for me tho, i will paste the code on here when i’m on my computer, thanks everyone i really appreciate the replies