<?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: ibrahim TOPBAŞI</title>
    <description>The latest articles on DEV Community by ibrahim TOPBAŞI (@ibrahim_topbai_1c4ab4f4e).</description>
    <link>https://dev.to/ibrahim_topbai_1c4ab4f4e</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%2F2610859%2Fec7a9e9d-d332-41f6-b689-746ba83271b0.jpg</url>
      <title>DEV Community: ibrahim TOPBAŞI</title>
      <link>https://dev.to/ibrahim_topbai_1c4ab4f4e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibrahim_topbai_1c4ab4f4e"/>
    <language>en</language>
    <item>
      <title>HTTP 200 does not mean your page rendered</title>
      <dc:creator>ibrahim TOPBAŞI</dc:creator>
      <pubDate>Thu, 24 Sep 2026 09:48:55 +0000</pubDate>
      <link>https://dev.to/ibrahim_topbai_1c4ab4f4e/http-200-does-not-mean-your-page-rendered-5bg1</link>
      <guid>https://dev.to/ibrahim_topbai_1c4ab4f4e/http-200-does-not-mean-your-page-rendered-5bg1</guid>
      <description>&lt;p&gt;A page can answer &lt;code&gt;200 OK&lt;/code&gt;, ship a full JSON payload, pass &lt;code&gt;node --check&lt;/code&gt;, and still render a completely blank screen. I shipped exactly that, and the status code told me everything was fine for a whole day.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;I maintain a small internal dashboard. The server sends an empty container and the data inline; the browser builds the rows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DATA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="cm"&gt;/* ... 355 KB ... */&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt; &lt;span class="cm"&gt;/* builds a card per item */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A field was renamed upstream (&lt;code&gt;candidates&lt;/code&gt; disappeared from the payload), but two reads of it survived in the template. The first card threw &lt;code&gt;TypeError: Cannot read properties of undefined (reading 'length')&lt;/code&gt;, &lt;code&gt;draw()&lt;/code&gt; unwound, and &lt;code&gt;#list&lt;/code&gt; stayed empty.&lt;/p&gt;

&lt;p&gt;Every check I had was green:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;check&lt;/th&gt;
&lt;th&gt;result&lt;/th&gt;
&lt;th&gt;what it actually proves&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;curl -o /dev/null -w '%{http_code}'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;200&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;bytes were served&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;response size&lt;/td&gt;
&lt;td&gt;355 KB&lt;/td&gt;
&lt;td&gt;the data is in the page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;node --check page.js&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;rc=0&lt;/td&gt;
&lt;td&gt;the file parses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rendered rows&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;— nobody measured this&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Syntax validity and runtime success are different questions. So is "the server answered" and "the user saw something".&lt;/p&gt;

&lt;h2&gt;
  
  
  The gate that would have caught it
&lt;/h2&gt;

&lt;p&gt;Run the page's own script in a context with a minimal DOM and count what it produced. Node's &lt;code&gt;vm&lt;/code&gt; module is enough — no browser needed for the fast path:&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;vm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;vm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;document&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fakeDom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;window&lt;/span&gt;&lt;span class="p"&gt;:&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="nx"&gt;vm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runInContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pageScript&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;          &lt;span class="c1"&gt;// throws? that is your blank page&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fakeDom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;byId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things bit me while writing that gate, both worth knowing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;code&gt;const&lt;/code&gt; at the top level of a &lt;code&gt;vm&lt;/code&gt; script is not a property of the context.&lt;/strong&gt; Lexical declarations live in the global &lt;em&gt;lexical&lt;/em&gt; scope, so &lt;code&gt;ctx.DATA&lt;/code&gt; is &lt;code&gt;undefined&lt;/code&gt; forever. Function declarations do become properties, which is why &lt;code&gt;ctx.draw&lt;/code&gt; worked and hid the problem. Read it back in the same context instead:&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="nx"&gt;vm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runInContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;typeof DATA !== "undefined" ? DATA.items.length : null&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without this, my gate read the item count as &lt;code&gt;0&lt;/code&gt;, so it would have happily accepted a page that rendered 5 of 50 rows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Calling &lt;code&gt;draw()&lt;/code&gt; yourself hides a page that never calls it.&lt;/strong&gt; Measure the state right after loading the script — that is what the browser shows — and only then drive the filters and the search box yourself.&lt;/p&gt;

&lt;p&gt;That last part matters more than it sounds: the second stale field read in my template sat in the &lt;em&gt;search&lt;/em&gt; branch. The page looked fine on load and exploded the moment anyone typed. A gate that only renders the default view would have signed off on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule I kept
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A proxy signal is an input, not a verdict.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;200&lt;/code&gt;, &lt;code&gt;rc=0&lt;/code&gt;, "the file was written", "the API accepted it" — all inputs. For anything a human looks at, measure the thing the human receives: the rendered screen, the published text, the delivered message. And when that measurement can't be taken (no runtime available, network down), the verdict is not green — it's &lt;em&gt;unmeasured&lt;/em&gt;, which keeps the item open instead of closing it silently.&lt;/p&gt;

&lt;p&gt;The fast gate runs on every build. A real headless Chromium run does the same count once a day, because a stub DOM is a stub, not a browser.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build small Android apps on one shared Kotlin core; the dashboard in this post is the one that tracks them. The apps are listed at &lt;a href="https://bulbildir.it.name.tr/" rel="noopener noreferrer"&gt;bulbildir.it.name.tr&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
      <category>webdev</category>
      <category>node</category>
    </item>
  </channel>
</rss>
