Skip to content

Fix issues with javascript not loading#147

Merged
hackall360 merged 2 commits intomainfrom
develop
Nov 22, 2025
Merged

Fix issues with javascript not loading#147
hackall360 merged 2 commits intomainfrom
develop

Conversation

@hackall360
Copy link
Copy Markdown
Contributor

No description provided.

claude and others added 2 commits November 22, 2025 05:51
The recent Vite build pipeline implementation (commits b83be35, cecd1b8)
broke the site because HTML files were still referencing manually minified
assets that no longer exist in the deployment.

**Root Cause:**
- HTML files referenced `script.min.js?v=97d7e8e` and `styles.min.css?v=97d7e8e`
- Vite build pipeline expects source file references (`script.js`, `styles.css`)
- Vite bundles CSS automatically with content hashes (e.g., `assets/styles-[hash].css`)
- Non-module scripts are not bundled by Vite but need to be copied to dist/
- Result: 404 errors because minified files don't exist in deployed dist/

**Changes Made:**

1. **Updated all HTML files** (index.html, about/, contact/, projects/, services/):
   - Changed `styles.min.css?v=97d7e8e` → `styles.css`
   - Changed `script.min.js?v=97d7e8e` → `script.js`
   - Removed manual cache-busting query params (Vite handles this)

2. **Updated copy-assets.js**:
   - Added `script.js` to the assets copy list
   - Ensures main JavaScript file is copied to dist/ after Vite build

**How it works now:**
- Vite processes HTML files and discovers asset references
- CSS: Vite bundles `styles.css` → `assets/styles-[hash].css` (automatic)
- JS: Non-module scripts copied manually via copy-assets.js
- Cache-busting: Handled by Vite content hashes + cache-bust.js meta tags
- Result: All assets load correctly from dist/ deployment

**Testing:**
- ✅ Build completes successfully
- ✅ script.js copied to dist/
- ✅ Vite-bundled CSS injected into HTML
- ✅ All 8 HTML pages processed

This fix aligns the HTML references with the new Vite build pipeline,
resolving the script loading failures and restoring site functionality.
…ues-01Xs6sC3aT9Zyq6vSQL7LjGj

Fix site display issues from recent changes
@hackall360 hackall360 merged commit 6c77341 into main Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants