having issues deploying THREE JS project #149988
Unanswered
cramination
asked this question in
Pages
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
Hello!
I am brand new to GitHub and this is my first time trying to host a project online, so my apologies for my ignorance on proper deployment! The problem I'm facing is I'm having difficulties getting the correct file configuration to display my 3D scene.
So my project is finished and ready to go! I just need to figure out why my files aren't being located and loaded on the page. I have done a solid 2 weeks of research to try and understand what I'm doing wrong, but I still don't know what I have to do.
I have pushed all of my files and deployed a "master" branch and created a "gh-pages" branch to deploy the "/dist" folder. I have seen many ways to structure my files, and came to the conclusion to have my index.html in the root directory along with package.json files and vite.config.js. My assets (containing JavaScript files, 3D models and textures) are placed in "/public" (unless suggested otherwise).
The problem I'm seeing here is the browser can't locate the index.js file that is created when I
npm run build
.I see that it's located in the repository, and I THOUGHT I have correctly referenced "main.js" in my "index.html" before running my build, but clearly the errors suggest otherwise. I'm familiar with relative paths and absolute paths, but obviously not familiar enough to build a structurally sound repository.
I'm also VERY aware that my file sizes are too big; It sits around 50mb which is WAY to big, and even lags on my computer. So it definitely won't load on mobile devices. But before I compress and optimize my files, I just want to actually figure out how to deploy them properly! If that is a likely culprit, I'll address that immediately. However, I have a feeling how I built or deployed my project is the main issue.
I have read #610703 discussion about how to resolve 404 errors and related material but still can't figure out my issue.
Here is the link to my repository:
https://github.com/cramination/comp-2.git
and here is webpage:
https://cramination.github.io/comp-2/
And here is what my file structure in Visual Studio Code looks like:
My apologies again if there's a better way to link my repositories and references! It seems like I really just need information on how to structure my files and deploy correctly. I have watched many tutorials and have hit a wall, so any help will greatly appreciated! Let me know if anything else is needed and I'll follow up.
Thank you for your time and patience!
Beta Was this translation helpful? Give feedback.
All reactions