
When Simple Code Changes Go Wrong | Learning In Public Day 17
You know that feeling when you think something's going to take 30 minutes, but then you're still debugging it two hours later? Yeah, that was my entire afternoon yesterday.
Quick summary
I was building the dining section for my travel directory, thinking I could just copy the components from the hotel section and adapt them. Simple, right? Wrong. What should have been a smooth process turned into a debugging nightmare that taught me some valuable lessons about assumptions and taking shortcuts.
Why I'm sharing this mess
Here's the thing - I'm doing this 60-day challenge to build a travel directory in public, and that means showing the ugly parts too. Not every coding session goes smoothly, and honestly, those messy days often teach me more than the perfect ones.
Living here in Bali with my partner, we get invited to stay at hotels and dine at restaurants pretty regularly. I wanted to create something where we could store all these experiences and maybe help other people discover cool places. But yesterday reminded me that even "simple" features can bite you.
The plan that seemed foolproof
So I'd already built the entire stays section - category pages, individual listing pages, filters, the works. The database was set up with a dining table, and I figured: "Perfect, I'll just tell Cursor AI to replicate the stays components but use the dining data instead."
I mean, the structure is basically the same, right? You have listings, categories, filters, detail pages. How hard could it be?
Plot twist: it was harder than expected.
What I tried first (spoiler: it didn't work)
I fired up Cursor and gave it what I thought was a clear prompt: "Hey, we've got the stays section working perfectly. Now let's build the dining section using the same components but pulling from the dining table instead."
Cursor seemed to understand. It started building components, creating the directory structure, setting up the data access functions. Everything looked good on paper.
But then I ran the development server and... chaos.
The debugging nightmare begins
First issue: the dining pages were pulling data from the stays table instead of the dining table. Okay, that's fixable.
Second issue: somehow the color scheme went completely rogue. Instead of the clean design I had for stays, the dining section was showing up in this weird orange color that I definitely didn't ask for.
Third issue: the hero section looked completely different - it had this black background that made no sense.
I'm sitting there thinking, "What is happening? This should be straightforward."
The real problem I discovered
After about an hour of back-and-forth with Cursor, I realized what was going wrong. The AI was getting confused between different database relationships.
See, in my setup, all listings (stays, dining, wellness, activities) are stored in a main listings table, and then each category has its own detailed table. So a restaurant listing exists in both the main listings table AND the dining-specific table.
But somewhere in the prompting process, Cursor started mixing up these relationships. It was pulling some data from the right place and other data from completely wrong tables.
How I tried to fix it (attempt #1)
I thought I could just be more specific in my prompts. I started explaining the database structure in detail, showing screenshots of the tables, being super explicit about which data should come from where.
Cursor would acknowledge the changes, make some updates, and then... still pull the wrong data.
The moment I realized my mistake
About 90 minutes into this mess, I had a realization: I was being too impatient.
Instead of taking the time to properly map out the component structure and data flow, I was trying to shortcut the process by asking the AI to "just copy everything and change the data source."
But here's what I learned - even when components look similar, the underlying data relationships can be subtly different. And those subtle differences matter a lot.
What actually worked (eventually)
I took a step back and decided to be more methodical:
First, I committed all my changes to GitHub - always save your work before trying experimental fixes
Then I analyzed exactly how the stays components worked - which functions called which data, how the relationships were structured
I rebuilt the dining components piece by piece instead of trying to copy everything at once
This approach took longer initially, but it actually worked. The dining section started pulling the right data, and I could control the styling properly.
The unexpected discovery about colors
One interesting thing that came out of this mess - that orange color scheme that appeared randomly? I actually kind of liked it.
It made me realize that having different color schemes for different categories might not be a bad idea. Stays could be one color, dining another, wellness a third. It helps users immediately understand which section they're in.
Sometimes the AI's "mistakes" lead to ideas you wouldn't have considered otherwise.
What the dining section looks like now
The basic structure is working:
Category page showing all restaurants, beach clubs, etc.
Individual listing pages with details, photos, and location info
Filter functionality (though I still need to fix the filter button styling)
Integration with the main listings database
It's not perfect yet - I still need to:
Fix some spacing issues
Add the Google Maps integration (still waiting for billing approval)
Set up the admin dashboard for easy content management
Add more sample data to test everything properly
Lessons I'm taking from this debugging session
Don't assume "simple" means "quick": Even when you think you're just copying existing functionality, there are always edge cases and subtle differences that can trip you up.
Save your work frequently: I'm getting better at committing changes to GitHub regularly. When you're experimenting and things go wrong, you want to be able to roll back easily.
Sometimes the AI gets confused too: Cursor is incredibly powerful, but it can get stuck in loops just like humans do. When that happens, starting fresh with a clearer approach often works better than trying to debug the confusion.
Embrace happy accidents: That random orange color scheme actually gave me a good idea for the overall design.
What I'm working on next
Tomorrow I'm going to:
Clean up the remaining styling issues
Get the Google Maps integration working (hopefully my billing gets approved)
Start building the admin dashboard so I can easily add new listings
Maybe tackle the wellness section if everything goes smoothly
I'm also thinking about adding some SEO-focused category pages like "Best restaurants in Canggu" or "Top beach clubs in Seminyak" - those could drive some good organic traffic.
Final thoughts
You know what's funny? I used to get really frustrated when coding sessions went like this. But now, especially doing this challenge in public, I'm starting to appreciate these messy days.
They remind me that building something real isn't just about the highlight reel moments. It's about pushing through the frustrating debugging sessions and learning something new in the process.
Plus, sharing these struggles feels more honest than only showing the polished final results. If you're building something yourself, you probably have days like this too.
Following along with my 60-day challenge? I'm documenting the entire journey of building this travel directory - the wins, the fails, and everything in between. Would love to hear about your own coding adventures in the comments.