I’m new to threejs and web applications in general, I have some good progress with some tutorials I’ve found, and I’m using VS Code and vite.
I want to test my work through a host server, my test project run fine using
npm run dev, so I made a build using
npm run build and uploaded it to a server and I’m met with a white page with some errors. So I took my code and tried it using tiinyhost (a web testing platform) and it worked so now I know my problem is not from my code -generally- and from the host.
The server I used is Bluehost / wordpress(here is a link for the test build out of the server test build) … I’m not a web developer, and I don’t know what type of server I’m working on. but my question is what is the settings/ server type/ etc. that threejs request? just the general data I know it’s not a 1 line answer, I just want to know where to start from!
Check out the network tab in your browser. You’ll see that your JS and CSS files fail to load.
This is to do with your build settings.
Looks like you put your app in the
folder, but the links to your JS and CSS files in the HTML file are pointing to
, when they should be pointing to
. EG your JS file is hosted at https://asfanco.com/app/test1/assets/index.f91b1046.js
, but your HTML points to https://asfanco.com/assets/index.f91b1046.js
You can either fix this manually by editing your HTML file, or by updating your vite settings - I’m unfamiliar with how it works, if it was a webpack project you would have a ‘homepage’ property in your package.json file that would let you set it.
@Arthur ok, that’s a great start. I think that will helps a lot … I’ll check this and see if it works.
Thanks for the help and your effort!
@Arthur it works! the problem was in the index.html when calling the assets, it points to
'/assets/... rather than
The problem is not 100% fixed as I had to manually edit the index.html, now I just need to know how to edit the
npm run build settings to point to the parent folder instead of the root.
Thanks a lot, much appreciated!