Hey DEV Community! ๐
I am currently building MOKSHA, an HTML5 Canvas game deeply rooted in Vedic philosophy. The game involves managing your Karma, avoiding Maya (Illusions), and achieving spiritual liberation.
Ironically, while building a game about waking up from cosmic illusions, I fell into a technical illusion myself yesterday. Let me tell you a chaotic detective story about how my game froze on a fresh repository clone, and how I found the silent assassin hiding in plain sight. ๐คก
๐ซ The Disaster: Works on Itch.io, Freezes on GitHub
So, there I was, ready to release a fresh update. I generated my build packages locally, zipped them up, and proudly uploaded them to Itch.io. I hit Publish, tested the live link, and everything worked flawlessly. High scores, smooth frames, total spiritual awakening.
Then, I casually walked over to my terminal, ran git add . followed by git push, and went to bed thinking I was an absolute pro.
The next morning, I wanted to double-check my clean repository, so I cloned it fresh into a new folder. I booted up the local server, and… the entire game was completely unclickable. Dead clicks. Frozen canvas. Total illusion (Maya). ๐
Opening up the browser console revealed a fierce wall of red text:
style.min.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
๐ต๏ธโโ๏ธ The Realization: It Wasn’t Me, It Was My .gitignore!
Initially, I blamed my sleep-deprived brain, thinking I forgot the chronological order of pushing and building. But when I opened my root directory to inspect the crime scene, I found the real culprit staring right back at me on lines 46 and 50 of my .gitignore file:
dist/
*.zip
index.min.html
The Ultimate Trap Exposed ๐ชค
Because dist/ was explicitly blacklisted in my .gitignore, Git was literally doing its job perfectly by completely ignoring my production builds during staging!
Here is exactly how the loop went down:
- I would run my build command locally.
- The dist/ folder would generate perfectly on my local computer.
- I manually zipped it and uploaded it to Itch.io (which is why Itch.io worked flawlessly!).
- I ran git push, blindly believing everything went to GitHub.
But Git silently left the dist/ folder behind on my machine. When I cloned the repository fresh, the HTML base file was aggressively looking for dist/main.min.js. Since it didn’t exist in the repo, the main game script never loaded. No script = No event listeners = A completely unclickable canvas!
๐ ๏ธ The Cosmic Realignment (The Fix)
Instead of overcomplicating things by fighting with hidden distribution folder pipelines for a lightweight web game, I decided to keep the repository structure completely transparent. I bypassed the production dist/ path entirely and routed the asset links straight to my raw source files:
- Updated dist/style.min.css โก๏ธ style.css
- Updated dist/main.min.js โก๏ธ src/main.js
After updating the HTML paths, committing, and pushing to GitHub, the miracle happened. The fresh clone initialized instantly, the event listeners attached perfectly, and the game was beautifully clickable again!
๐งโโ๏ธ Lessons Learned From the Samsara of Coding
- Inspect your .gitignore early: It doesn’t care about your deployment feelings. If a folder is blacklisted, it stays local forever.
- A 404 can freeze your entire UI: If your canvas element acts like a dead image, check if your script files actually made it past the repository gates.
Now that the asset pipes are clear and tracked correctly on GitHub, I am taking this clean codebase straight into Google AI Studio to implement the new Vedic Tutorial Mode and a bilingual English/Hindi toggle button.
Drop a comment below if your .gitignore has ever gaslit you into believing your code was broken. Let’s share the trauma! ๐
๐ค AI Assistant Disclaimer: This highly dramatic devlog was structured and polished with the help of an AI collaborator to turn a frustrating debugging session into an educational sushupti (deep awareness) moment for other indie devs.
๋ต๊ธ ๋จ๊ธฐ๊ธฐ