<?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: SystemCraftDev</title>
    <description>The latest articles on DEV Community by SystemCraftDev (@systemcraftdev).</description>
    <link>https://dev.to/systemcraftdev</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4066683%2F883dce22-d72f-4e9c-86fb-510fd7ef40a8.png</url>
      <title>DEV Community: SystemCraftDev</title>
      <link>https://dev.to/systemcraftdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/systemcraftdev"/>
    <language>en</language>
    <item>
      <title>How to Fix 'Cannot Read Properties of Undefined' (Without Losing Your Mind)</title>
      <dc:creator>SystemCraftDev</dc:creator>
      <pubDate>Tue, 11 Aug 2026 02:47:34 +0000</pubDate>
      <link>https://dev.to/systemcraftdev/how-to-fix-cannot-read-properties-of-undefined-without-losing-your-mind-j8</link>
      <guid>https://dev.to/systemcraftdev/how-to-fix-cannot-read-properties-of-undefined-without-losing-your-mind-j8</guid>
      <description>&lt;p&gt;Your console fills up with red text, and near the top sits some version of &lt;code&gt;TypeError: Cannot read properties of undefined (reading 'name')&lt;/code&gt;. Nothing about that sentence feels helpful on first read — but it's actually one of the more precise errors JavaScript gives you. It's just easy to misread under pressure.&lt;/p&gt;

&lt;p&gt;The error isn't saying your program is broken. It's saying: at this exact line, you tried to read a property off a value that turned out to be &lt;code&gt;undefined&lt;/code&gt;. That's a narrow, specific claim — and once you know how to read it, the fix is usually mechanical.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the error is actually telling you
&lt;/h2&gt;

&lt;p&gt;Take this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;targetId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// TypeError: Cannot read properties of undefined (reading 'name')&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the message right to left. &lt;code&gt;(reading 'name')&lt;/code&gt; tells you which property access failed — &lt;code&gt;.name&lt;/code&gt;. &lt;code&gt;Cannot read properties of undefined&lt;/code&gt; tells you what it was trying to read &lt;code&gt;.name&lt;/code&gt; &lt;em&gt;off of&lt;/em&gt; — something that was &lt;code&gt;undefined&lt;/code&gt;. Put together: whatever sits to the left of &lt;code&gt;.name&lt;/code&gt; in your code — here, &lt;code&gt;user&lt;/code&gt; — wasn't what you expected it to be.&lt;/p&gt;

&lt;p&gt;The message never claims &lt;code&gt;.name&lt;/code&gt; itself is the problem. &lt;code&gt;.name&lt;/code&gt; is just where the crash became visible. The real question is always one step earlier: why was &lt;code&gt;user&lt;/code&gt; undefined in the first place? In this example, &lt;code&gt;.find()&lt;/code&gt; returns &lt;code&gt;undefined&lt;/code&gt; when nothing matches — so either &lt;code&gt;targetId&lt;/code&gt; is wrong, or the user genuinely isn't in the list yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix, step by step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Read the property name in the error&lt;/strong&gt; (&lt;code&gt;'name'&lt;/code&gt; in this case) — that tells you which line and which access failed, nothing more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trace back to where the undefined value came from.&lt;/strong&gt; Find the line that assigned, returned, or fetched it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask why it's undefined &lt;em&gt;there&lt;/em&gt;, specifically.&lt;/strong&gt; Common causes: an array method (&lt;code&gt;.find&lt;/code&gt;, &lt;code&gt;.pop&lt;/code&gt;, array indexing) that found nothing, a destructured key that doesn't match the actual object shape, or code that runs before an async fetch has resolved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fix the actual cause&lt;/strong&gt;, not just the crash site. If the value can legitimately be missing sometimes, guard for it deliberately. If it should never be missing, the bug is upstream — a typo, a wrong assumption about timing, or a mismatched API response shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confirm with a &lt;code&gt;console.log&lt;/code&gt;&lt;/strong&gt; right before the crashing line before you touch anything — print the variable itself, not just the property, so you can see exactly what you're working with.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Two mistakes worth knowing about ahead of time
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reaching for &lt;code&gt;?.&lt;/code&gt; as a reflex instead of a decision.&lt;/strong&gt; Optional chaining (&lt;code&gt;user?.name&lt;/code&gt;) makes the error go away, but it doesn't answer why &lt;code&gt;user&lt;/code&gt; was undefined. Sometimes that's the right call — the data is genuinely optional. Other times it quietly hides a real bug, the same way a bare &lt;code&gt;except:&lt;/code&gt; in Python swallows errors you actually needed to see. Use &lt;code&gt;?.&lt;/code&gt; when missing data is expected and handled; don't use it just to make red text disappear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assuming the crash line is where the bug lives.&lt;/strong&gt; The value was usually already wrong several lines — or several files — earlier. A common version of this: reading &lt;code&gt;props.data.items&lt;/code&gt; before an API call has actually resolved, because the component rendered on the very first pass with no data yet. The crash shows up wherever the property access happens, not wherever the value went wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  A debugging habit that works
&lt;/h2&gt;

&lt;p&gt;Before changing anything, &lt;code&gt;console.log()&lt;/code&gt; the variable itself, one line above the crash — not the property, the whole thing. If it's &lt;code&gt;undefined&lt;/code&gt;, walk backward: where was it supposed to be set, and did that code actually run before this line did? Async timing is the single most common root cause behind this error in real apps — check whether you're reading data before a &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;await&lt;/code&gt;, or state update has actually completed.&lt;/p&gt;

&lt;p&gt;Once you know &lt;em&gt;why&lt;/em&gt; it's undefined, the fix is usually one of two things: guard for it on purpose with &lt;code&gt;?.&lt;/code&gt; and a sensible fallback (&lt;code&gt;user?.name ?? "Unknown"&lt;/code&gt;), or fix whatever upstream logic is producing an empty value when it shouldn't be. Both are valid — just make sure you know which one you're doing, rather than reaching for &lt;code&gt;?.&lt;/code&gt; and moving on before you find out.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post is adapted from the &lt;a href="https://systemcraftpress.com/guides/javascript-essentials/?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=cannot-read-properties-of-undefined" rel="noopener noreferrer"&gt;JavaScript Essentials Companion Guide&lt;/a&gt; — a practical, no-fluff guide to JavaScript for developers who want to understand it, not just copy it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>debugging</category>
    </item>
    <item>
      <title>How to Resolve a Git Merge Conflict (Without Panicking)</title>
      <dc:creator>SystemCraftDev</dc:creator>
      <pubDate>Fri, 07 Aug 2026 03:32:27 +0000</pubDate>
      <link>https://dev.to/systemcraftdev/how-to-resolve-a-git-merge-conflict-without-panicking-5co4</link>
      <guid>https://dev.to/systemcraftdev/how-to-resolve-a-git-merge-conflict-without-panicking-5co4</guid>
      <description>&lt;p&gt;If you've ever pulled the latest changes, watched Git print &lt;code&gt;CONFLICT (content): Merge conflict in&lt;/code&gt;, and felt your stomach drop — you're not alone, and it's not actually bad news.&lt;/p&gt;

&lt;p&gt;A merge conflict means two branches changed the same part of a file, and Git isn't willing to guess which version you want. That's it. It's not a sign you did something wrong; it's Git asking a question only a human can answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a conflict actually looks like
&lt;/h2&gt;

&lt;p&gt;Open the flagged file and you'll see something like this dropped right into your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
&lt;/span&gt;&lt;span class="p"&gt;const timeout = 3000;
&lt;/span&gt;&lt;span class="gh"&gt;=======
&lt;/span&gt;&lt;span class="p"&gt;const timeout = 5000;
&lt;/span&gt;&lt;span class="gi"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature/update-timeout
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three markers, three jobs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;/code&gt; marks the start of &lt;em&gt;your&lt;/em&gt; current branch's version.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;=======&lt;/code&gt; is the dividing line between the two.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature/update-timeout&lt;/code&gt; marks the end of the &lt;em&gt;incoming&lt;/em&gt; branch's version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything between the first two markers is what you have. Everything between the second two is what's coming in. Your job is to replace the whole block — markers included — with whatever the correct final code should be.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix, step by step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;git status&lt;/code&gt;&lt;/strong&gt; to see which files are conflicted. Work through them one at a time, not all at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the file and read both versions carefully&lt;/strong&gt; before touching anything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide the correct outcome.&lt;/strong&gt; You've got three options: keep yours, keep theirs, or combine both into something new that reflects what actually needs to happen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete the conflict markers entirely.&lt;/strong&gt; The file should read exactly as it should in production — no &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/code&gt;, no &lt;code&gt;=======&lt;/code&gt;, no &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; left behind anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage it:&lt;/strong&gt; &lt;code&gt;git add filename.ext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finish the merge:&lt;/strong&gt; &lt;code&gt;git commit -m "Resolve merge conflict in filename.ext"&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's the whole mechanical process. The part that actually takes judgment is step 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two rules that matter most
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Never guess.&lt;/strong&gt; If you're not sure which version is correct, a two-minute conversation with whoever wrote the other change is faster — and safer — than assuming and shipping the wrong one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Never default to keeping your own version.&lt;/strong&gt; It's tempting when you're in a hurry, but the incoming change might contain real work you'd be silently throwing away. Read both sides before you decide.&lt;/p&gt;

&lt;p&gt;And always test after resolving — confirm the code still builds and runs correctly before you commit. A conflict resolved incorrectly is often worse than one left open, because a bad resolution can quietly discard someone's work or introduce a bug nobody notices until much later.&lt;/p&gt;

&lt;h2&gt;
  
  
  The best conflict is the one you never have
&lt;/h2&gt;

&lt;p&gt;A few habits go a long way: pull from &lt;code&gt;main&lt;/code&gt; frequently while you're on a feature branch, keep branches short-lived, and say something when you know you're working in the same area of code as a teammate. &lt;code&gt;git pull origin main&lt;/code&gt; run regularly keeps your branch close enough to &lt;code&gt;main&lt;/code&gt; that conflicts, when they do happen, stay small.&lt;/p&gt;

&lt;p&gt;If a conflict lands in code you didn't write and don't fully understand, that's the moment to stop and ask, not guess. There's no shame in "I've got a conflict in code I'm not familiar with — can you help me sort it out?" It's a two-minute question that saves everyone a much worse afternoon.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post is adapted from the &lt;a href="https://systemcraftpress.com/guides/git-github/?utm_source=crosspost&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Git &amp;amp; GitHub Companion Guide&lt;/a&gt; — a practical, no-fluff guide to Git for developers who want to understand it, not just survive it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Read a Python Traceback Without Panicking</title>
      <dc:creator>SystemCraftDev</dc:creator>
      <pubDate>Mon, 03 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/systemcraftdev/how-to-read-a-python-traceback-without-panicking-57dj</link>
      <guid>https://dev.to/systemcraftdev/how-to-read-a-python-traceback-without-panicking-57dj</guid>
      <description>&lt;p&gt;Your script crashes, a wall of red text fills the terminal, and the instinct is to scroll straight to the top and start reading. That's the wrong direction — and it's probably why tracebacks feel scarier than they are.&lt;/p&gt;

&lt;p&gt;A traceback isn't Python telling you that you've broken something beyond repair. It's Python telling you exactly where execution stopped and why, in more detail than almost any other language bothers to give you. The trick is reading it in the right order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read it bottom to top
&lt;/h2&gt;

&lt;p&gt;Take this traceback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Traceback (most recent call last):
&lt;/span&gt;&lt;span class="gp"&gt;  File "main.py", line 8, in &amp;lt;module&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="go"&gt;    result = divide(10, 0)
  File "main.py", line 4, in divide
    return a / b
ZeroDivisionError: division by zero

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start at the &lt;strong&gt;last line&lt;/strong&gt; — that's the actual error: &lt;code&gt;ZeroDivisionError: division by zero&lt;/code&gt;. That alone tells you what kind of problem you're dealing with.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;line right above it&lt;/strong&gt; shows exactly where inside the code that error was raised — here, the &lt;code&gt;return a / b&lt;/code&gt; line inside &lt;code&gt;divide()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Working further &lt;strong&gt;upward&lt;/strong&gt; traces the chain of calls that got you there, oldest call at the top. For a short traceback like this one, you don't need much more than the bottom two lines: the exception type and message, and the exact line that raised it. Everything above that is just context for how execution arrived there — useful when the bug isn't obvious, skippable when it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The most common way people make it worse
&lt;/h2&gt;

&lt;p&gt;There's a real temptation, especially under a deadline, to wrap the crashing line in a bare &lt;code&gt;except:&lt;/code&gt; and move on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;risky_operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# catches everything, including real bugs
&lt;/span&gt;    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't. A bare &lt;code&gt;except&lt;/code&gt; catches &lt;em&gt;everything&lt;/em&gt; — typos, keyboard interrupts, bugs you don't know exist yet — and silently hides all of them. Catch the specific exception you're actually expecting instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;risky_operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;handle_bad_input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now anything you didn't anticipate still surfaces as a real, readable traceback instead of vanishing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two mistakes worth knowing about ahead of time
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Assuming the error is where the traceback "feels" like it should be.&lt;/strong&gt; Often the actual bug happened several lines earlier — a variable got set incorrectly, and the crash is just where that bad value finally caused a visible problem. The traceback tells you where things &lt;em&gt;stopped&lt;/em&gt;, not necessarily where they went &lt;em&gt;wrong&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixing the symptom instead of the cause.&lt;/strong&gt; Wrapping a crashing line in &lt;code&gt;try&lt;/code&gt;/&lt;code&gt;except&lt;/code&gt; and moving on makes the error message go away, but the bad state that caused it is usually still there — it just surfaces somewhere else, later, and harder to trace back.&lt;/p&gt;

&lt;h2&gt;
  
  
  A debugging habit that actually works
&lt;/h2&gt;

&lt;p&gt;Read the full error message and the exact line it points to &lt;em&gt;before&lt;/em&gt; changing anything. Reproduce the bug with the smallest input that still triggers it. Add a &lt;code&gt;print()&lt;/code&gt; — or drop a &lt;code&gt;breakpoint()&lt;/code&gt; right before things go wrong — and check your assumptions about a variable's type and value directly with &lt;code&gt;type(x)&lt;/code&gt; and &lt;code&gt;print(x)&lt;/code&gt; rather than guessing. Change one thing at a time; resist fixing five suspected causes simultaneously, because when it works you won't know which one mattered.&lt;/p&gt;

&lt;p&gt;And when you're genuinely stuck: explain the problem out loud, line by line, as if to someone else. Naming your assumptions explicitly is often enough to spot the one that's wrong.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post is adapted from the &lt;a href="https://systemcraftpress.com/guides/python-essentials/?utm_source=crosspost&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Python Essentials Companion Guide&lt;/a&gt; — a practical, no-fluff reference built for developers who want to actually understand Python, not just copy syntax.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>debugging</category>
    </item>
  </channel>
</rss>
