Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 22484

Vite React app: "npm run build" not building "dist" folder with all necessary files for deployment

$
0
0

I'm trying to deploy my vite app to my repo on github but something started to fail. I was able to deploy this project several times but after some changes made and purchasing the domain for publishing this website, it just started to fail it's building process. I wanted to use my repository as the host with the purchased domain so that anyone could access the site with it's domain name, and not with the github.io URL. These are my configuration files for the building process:

PACKAGE.JSON{ "name": "urbanstrings", "private": false, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, "dependencies": { "emailjs-com": "^3.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-just-parallax": "^3.1.16", "react-modal": "^3.16.1", "react-router-dom": "^6.22.3", "scroll-lock": "^2.1.5" }, "devDependencies": { "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.19", "eslint": "^8.57.0", "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "postcss": "^8.4.38", "tailwindcss": "^3.4.3", "vite": "^5.2.0" } }

VITE.CONFIG.JS`import { defineConfig } from 'vite'import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/export default defineConfig({base: '/SAXBookkeepers/',plugins: [react()],})`

The console errors are 404 errors. Problems finding main.js file or even 404 errors referencing to these two specific files from the dist folder: "index-BvVXP-pY.css" and "index-C8uTiFKf.js". I think these to files aren't being uploaded to the repository on github, because I only see them in my local folder, but I don't understand why it's not pushing all files. I assume this has to do with the problem I'm facing, that's why i'd like to know if there's something in the configuration files that should be modified or something like that.

This is what the console logs after deploying to github:CONSOLE LOG ERROR

The only thing that's being loaded of the website when accessing is the favicon from the head, all rest is just blank.Please let me know if there's anything else that I could show from the proyect or the errors to help find the solutions. Thanks in advance.


Viewing all articles
Browse latest Browse all 22484

Trending Articles