<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhijeet Singh</title>
    <description>The latest articles on DEV Community by Abhijeet Singh (@abhijeet-singh).</description>
    <link>https://dev.to/abhijeet-singh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3299229%2Fcc9da826-e0dd-490c-b835-ab30a303eb09.png</url>
      <title>DEV Community: Abhijeet Singh</title>
      <link>https://dev.to/abhijeet-singh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhijeet-singh"/>
    <language>en</language>
    <item>
      <title>Debugging a React Bug That Wasn't Mine: A Dev's Breakdown</title>
      <dc:creator>Abhijeet Singh</dc:creator>
      <pubDate>Sat, 28 Jun 2025 07:42:01 +0000</pubDate>
      <link>https://dev.to/abhijeet-singh/debugging-a-react-bug-that-wasnt-mine-a-devs-breakdown-32c8</link>
      <guid>https://dev.to/abhijeet-singh/debugging-a-react-bug-that-wasnt-mine-a-devs-breakdown-32c8</guid>
      <description>&lt;p&gt;Hey there! I'm Abhijeet, a dev who just spent an entire day pulling his hair out over a bug that turned out to be... &lt;em&gt;not my bug at all&lt;/em&gt;. Grab some popcorn, maybe a debugger too, because this is the story of how Brave browser gaslit me and my console cried in minified.&lt;br&gt;
Let's dive into the rabbit hole, one console error at a time.&lt;/p&gt;
&lt;h2&gt;
  
  
  Everything Was Fine... Until It Wasn't
&lt;/h2&gt;

&lt;p&gt;So I'm vibing, building this slick React project using Vite. Nothing fancy, just your average component soup with some nice icons sprinkled in.&lt;br&gt;
I deployed it on Netlify, excited to finally show it off. Opened it in Brave browser, loaded the app, and boom:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🚨 &lt;code&gt;Icons ghosted me.&lt;/code&gt; 🚨 &lt;code&gt;Text went poof.&lt;/code&gt; 🚨 &lt;code&gt;Console dropped this bomb:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Uncaught Error: Minified React error #130
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've ever seen this, you know React is basically saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I broke. You figure it out."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I clicked the link React provided and it told me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Element type is invalid: expected a string (for built-in components) or a 
class/function (for composite components) but got: undefined.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Translation:&lt;/strong&gt; You're probably importing a component that doesn't exist. Classic. But I double-checked all my imports...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Fun fact:&lt;/strong&gt; This all went down while building 🎬&lt;a href="http://flicknestapp.netlify.app" rel="noopener noreferrer"&gt;FlickNest&lt;/a&gt; — a movie discovery app where you can search trending titles, explore binge-worthy shows, and keep up with the latest releases.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  It Must Be the Icons
&lt;/h2&gt;

&lt;p&gt;Naturally, I thought maybe I messed up icon imports. &lt;code&gt;React #130&lt;/code&gt; is infamous for this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { FaXTwitter } from "react-icons/fa6"; // ✅
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Still the error stayed, and so did my growing headache.&lt;br&gt;
I swapped out &lt;code&gt;react-icons&lt;/code&gt; for &lt;code&gt;lucide-react&lt;/code&gt;, thinking maybe Brave didn't like the old icon set. You know, new icons, new luck?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Spoiler:&lt;/strong&gt; no luck.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clearly, this wasn't about icons anymore. This was personal.&lt;/p&gt;
&lt;h2&gt;
  
  
  Brave is Blocking My Files?
&lt;/h2&gt;

&lt;p&gt;Then I noticed something odd in DevTools. The error trace pointed to a file named:&lt;br&gt;
&lt;code&gt;ads.914af30a.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The name. "ads"? Like, ads-ads?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instant flashback:&lt;/strong&gt; Brave hates anything that even smells like an ad. Could it be blocking my own JS chunks?&lt;/p&gt;

&lt;p&gt;So I popped open my &lt;code&gt;vite.config.ts&lt;/code&gt; and told Vite:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hey buddy, let's name things like &lt;strong&gt;cryptographic garbage&lt;/strong&gt; instead of triggering Brave's fight-or-flight."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// vite.config.ts
build: {
  rollupOptions: {
    output: {
      chunkFileNames: 'assets/[hash].js',      // Dynamic chunks
      entryFileNames: 'assets/[hash].js',      // Entry points
      assetFileNames: 'assets/[hash][extname]' // Assets like CSS/images
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures Vite won't generate scary filenames like &lt;code&gt;ads.chunk.js&lt;/code&gt;. Totally  browser-friendly.&lt;br&gt;
I rebuilt. Refreshed. And guess what?&lt;br&gt;
Still broken.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Plot Twist I Didn't See Coming
&lt;/h2&gt;

&lt;p&gt;Out of desperation, I clicked the error trace again — this time determined to follow every breadcrumb. I expanded the stack trace in DevTools, expecting to see something from my source files.&lt;/p&gt;

&lt;p&gt;But instead, I noticed a weird nested structure:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;content script &amp;gt; CSS Peeper &amp;gt; ads.[hash].js&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hold up. CSS Peeper?&lt;/p&gt;

&lt;p&gt;That's a Chrome/Brave extension I use to peek at styles. Apparently, it injects its own React app into every webpage like it owns the place.&lt;br&gt;
And that app... was crashing.&lt;/p&gt;

&lt;p&gt;Let me repeat: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I had been debugging &lt;em&gt;someone else's&lt;/em&gt; React crash.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For. Eight. Hours.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Real Villain Was Installed in My Browser All Along
&lt;/h2&gt;

&lt;p&gt;Here's what was really happening:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS Peeper injects its own React-powered UI into every webpage&lt;/li&gt;
&lt;li&gt;It loads a script called something like &lt;code&gt;ads.something.js&lt;/code&gt; (coincidence? I think not.)&lt;/li&gt;
&lt;li&gt;That script broke. Probably missing an icon or internal dependency&lt;/li&gt;
&lt;li&gt;React saw the crash and yelled&lt;/li&gt;
&lt;li&gt;But the console blamed my app&lt;/li&gt;
&lt;li&gt;To make things worse, Brave saw the filename &lt;code&gt;ads.[hash].js&lt;/code&gt; and probably flagged or throttled it due to its aggressive ad-blocking rules — even though it wasn’t an actual ad.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Plot twist:&lt;/strong&gt; I wasn't the villain. I was just collateral damage.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Fix (That Took Me 5 Seconds... After 8 Hours)
&lt;/h2&gt;

&lt;p&gt;The fix? Comically simple.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;brave://extensions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Turn off CSS Peeper&lt;/li&gt;
&lt;li&gt;Reload the page&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Boom. Everything just worked.&lt;br&gt;
Icons? Back. Text? Back. Me? Slightly traumatized.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx956g8p32pgp9r5wfilx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx956g8p32pgp9r5wfilx.jpg" alt="A developer character finally relaxing, but with dark circles under their eyes, signifying the ordeal with a " width="720" height="960"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What I Learned (So You Don't Lose a Day Like Me)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Test in Incognito Mode First&lt;/strong&gt;&lt;br&gt;
No extensions = no hijinks. This should be your first debugging step when things get weird.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Minified Errors Are Gaslighting You&lt;/strong&gt;&lt;br&gt;
Use dev mode for real errors:&lt;br&gt;
&lt;code&gt;npm run dev&lt;/code&gt;&lt;br&gt;
React will be way more helpful when it's not trying to save bytes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Be Careful With File Names&lt;/strong&gt;&lt;br&gt;
Browsers like Brave can block:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JS/CSS files named &lt;code&gt;ads.js&lt;/code&gt;, &lt;code&gt;sponsor.css&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;DOM elements with classes like &lt;code&gt;.ad-banner&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if they're not ads. So avoid those terms when naming stuff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Double-Check Icon Imports&lt;/strong&gt;&lt;br&gt;
My imports were fine, but always verify&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { ChevronLeft } from 'lucide-react';
console.log(ChevronLeft); // Should not be undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Look for "content script" in DevTools&lt;/strong&gt;&lt;br&gt;
If you see "content script" or an extension name in the error stack, it's probably not your fault.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;
Seeing &lt;code&gt;React error #130&lt;/code&gt; in Brave? Icons or text gone missing?&lt;br&gt;
Before you nuke your app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try &lt;strong&gt;Incognito mode&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Check if any &lt;strong&gt;extensions&lt;/strong&gt; are crashing&lt;/li&gt;
&lt;li&gt;Avoid ad-looking &lt;strong&gt;file names&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes the real bug lives rent-free in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I lost an entire day to an error that wasn't mine. But now you don't have to.&lt;br&gt;
If you're ever staring at your DevTools wondering what went wrong — remember to ask yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Is this me? Or is this just Brave begin Brave?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Happy debugging. 🚀&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>debugging</category>
      <category>browsers</category>
    </item>
  </channel>
</rss>
