Three.js development doesn't load file correct

I am building a website with Three.js for viewing STL file. Initially, I successfully managed to run the website on my localhost, where STL files were loading and displaying correctly. However, I ran into issue: the STL files and canvas components are now missing without any error messages or warnings after npx vite build on live server.

I tried to rebuild project. I’ve also noticed that when running npx vite preview, the canvas appears but without the STL files.

I tried to rebuild project a few times. with npx vite build, but it still didn’t work.


Not enough info to help you I’m afraid. Can you link to your github repo for the project, or create one if you haven’t yet?

@manthrax thank you for offering to help. GitHub - young-oct/OCT-CT-fusion-website: This website, built with HTML, CSS, and JavaScript, showcases middle ear CT and OCT results. It features an intuitive interface and interactive elements, presenting medical imaging in a clear, user-friendly format.
here is my main repo.

I think I somewhat pinpoint the issue that the externally referenced objects i.e png stl are not correctly imported by vite. I setup a dummy project here with minimal code GitHub - young-oct/app: dummy project to debug