<?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: Femi Akinyemi</title>
    <description>The latest articles on DEV Community by Femi Akinyemi (@femi_akinyemi).</description>
    <link>https://dev.to/femi_akinyemi</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%2F363773%2Ff660be1b-b50b-44cb-b4ff-cdeba2da79ca.jpg</url>
      <title>DEV Community: Femi Akinyemi</title>
      <link>https://dev.to/femi_akinyemi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/femi_akinyemi"/>
    <language>en</language>
    <item>
      <title>My Fix for One Chrome Bug Broke Every Export on AWS Lambda. My Laptop Said It Was Fine.</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Thu, 26 Nov 2026 13:21:20 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/my-fix-for-one-chrome-bug-broke-every-export-on-aws-lambda-my-laptop-said-it-was-fine-39ib</link>
      <guid>https://dev.to/femi_akinyemi/my-fix-for-one-chrome-bug-broke-every-export-on-aws-lambda-my-laptop-said-it-was-fine-39ib</guid>
      <description>&lt;p&gt;I'm building &lt;a href="https://tilzix.com/?utm_source=devto" rel="noopener noreferrer"&gt;Tilzix&lt;/a&gt;. You paste a website, and it makes carousels and short videos in that brand's style. Each slide is a small web page. To make a video, headless Chrome (Chrome with no screen) runs on AWS Lambda. It opens the slide, takes 30 screenshots a second, and sends them to ffmpeg. Three tabs work at the same time, so a deck of eight slides doesn't take long.&lt;/p&gt;

&lt;p&gt;This is about a fix I shipped on a Monday. It quietly stopped every export from finishing until Wednesday. My laptop said everything was fine the whole time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug one: the tab that got smaller
&lt;/h2&gt;

&lt;p&gt;On 22 Nov a video came out wrong. The first frames of one slide showed only its top-left corner, on black.&lt;/p&gt;

&lt;p&gt;All three tabs were in one browser window, so only one tab was in front. Chrome treats the other tabs as "in the background". By the time recording started, one of them had shrunk to Chrome's own window size, &lt;strong&gt;756×469&lt;/strong&gt;. The slide is much bigger than that. I take screenshots with &lt;code&gt;captureBeyondViewport: false&lt;/code&gt;, so the screenshot showed only what fit: the corner.&lt;/p&gt;

&lt;p&gt;I fixed it in three ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Chrome flags so background tabs aren't slowed down or half drawn:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="s2"&gt;"--disable-backgrounding-occluded-windows"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="s2"&gt;"--disable-renderer-backgrounding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="s2"&gt;"--disable-background-timer-throttling"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;A size check just before recording. If the tab is the wrong size, set it again:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;tries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;tries&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;tries&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="sb"&gt;`${innerWidth}x${innerHeight}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="sb"&gt;`${w}x${h}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setViewport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Each tab in its own browser context (think of it as a separate incognito window), so no tab is ever in the background:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;LANES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
       &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createBrowserContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setViewport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I tested it on my laptop. The videos were perfect. I shipped it on 23 Nov.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug two: nothing finished
&lt;/h2&gt;

&lt;p&gt;Two days later I was testing something else: posting a video straight to TikTok. The app said: "The export stopped partway." I tried again. Same thing. And again.&lt;/p&gt;

&lt;p&gt;The Lambda logs showed this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR [export] TargetCloseError: Protocol error (Target.createTarget): Target closed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I went back through the logs. &lt;strong&gt;Not one export had finished since the 23 Nov deploy.&lt;/strong&gt; Nothing warned me. The rest of the site looked fine. Even the other Lambda job that uses Chrome, reading a brand's website, kept working, because it only ever opens one tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same error, different cause
&lt;/h2&gt;

&lt;p&gt;This part could have cost me another day. I had seen "Target closed" earlier that same week, on my own Mac. The script I run before every deploy crashed with it.&lt;/p&gt;

&lt;p&gt;That time it was memory. My Mac has 16 GB, and 12.5 GB of swap was in use. 4.2 GB of that was test Chromes left open by earlier crashed runs. Each crash left more Chrome running, so the next crash came sooner.&lt;/p&gt;

&lt;p&gt;Same words, same week, two causes that have nothing to do with each other. "Target closed" only means Puppeteer lost its connection to Chrome. It doesn't tell you why Chrome went away. Now I read it as "Chrome died, go find out what killed it", not as the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it only broke on Lambda
&lt;/h2&gt;

&lt;p&gt;Chrome on Lambda comes from &lt;code&gt;@sparticuz/chromium&lt;/code&gt;. It squeezes Chrome into Lambda's small, locked-down space. It starts Chrome with these flags, among others:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--single-process --no-zygote --in-process-gpu --no-sandbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--single-process&lt;/code&gt; is the one that matters. Chrome normally splits its work into many processes. Here, everything runs in one. On my laptop Chrome runs the normal way, so a second browser context is no problem. On Lambda, making one killed Chrome straight away. The first tab opened fine. The second &lt;code&gt;createBrowserContext()&lt;/code&gt; took the whole browser down.&lt;/p&gt;

&lt;p&gt;I didn't dig into Chrome's source code to find exactly why. What I can show is that it happens every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proving it, not guessing
&lt;/h2&gt;

&lt;p&gt;I didn't want to ship a second guess, so I ran the exact image Lambda runs, on my Mac:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --rm --platform linux/arm64 \
  -e &lt;span class="nv"&gt;AWS_EXECUTION_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;AWS_Lambda_nodejs22.x \
  -e &lt;span class="nv"&gt;AWS_LAMBDA_FUNCTION_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt; \
  --entrypoint node \
  -v &lt;span class="s2"&gt;"$PWD/test-tabs.mjs"&lt;/span&gt;:/var/task/test-tabs.mjs:ro \
  my-lambda-image:latest \
  /var/task/test-tabs.mjs contexts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One trap on the way: without &lt;code&gt;AWS_EXECUTION_ENV&lt;/code&gt;, the packaged Chrome can't find its libraries and fails with a different error. With it set, the container acts like Lambda.&lt;/p&gt;

&lt;p&gt;The test starts Chrome the same way the export does and opens three tabs two ways: once with separate contexts, once with all three in the default one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contexts  FAILED: Protocol error (Target.createTarget): Target closed
same      OK: 3 tabs open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same image, same flags, same error as production. That's when I trusted the fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&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="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;onLambda&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createBrowserContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;onLambda()&lt;/code&gt; just checks for &lt;code&gt;AWS_LAMBDA_FUNCTION_NAME&lt;/code&gt;. On Lambda, all tabs share one context. Chrome there has no windows, so tabs keep their own size anyway. The flags and the size check from the first fix stay on everywhere. If a tab ever does shrink, it gets resized before a single frame is taken.&lt;/p&gt;

&lt;p&gt;Exports have finished since, and the videos come out right.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My laptop isn't production, even with "the same" Chrome.&lt;/strong&gt; Chrome on a Mac and Chrome on Lambda are different builds with different flags. If a fix changes how Chrome behaves, test it on the real image. Running it with &lt;code&gt;docker run&lt;/code&gt; takes five minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the flags your Chrome package starts with.&lt;/strong&gt; Printing &lt;code&gt;chromium.args&lt;/code&gt; is one line. Seeing &lt;code&gt;--single-process&lt;/code&gt; would have warned me that opening another context was risky.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An error message tells you what happened, not why.&lt;/strong&gt; "Target closed" meant memory on my Mac and a Chrome flag on Lambda, in the same week.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Silent failures cost the most.&lt;/strong&gt; The bug lived for two days, and I only caught it while testing something else. An alert for failed exports is the next thing on my list, so the next one tells me first.&lt;/p&gt;

&lt;p&gt;Last week I wrote about &lt;a href="https://dev.to/femi_akinyemi/ai-wrote-most-of-my-app-real-users-found-what-it-missed-1fai"&gt;a Lambda that was never rebuilt&lt;/a&gt;. There, the code was fixed and production wasn't. This one is the opposite: production ran exactly the code I wrote, and the code was the problem. Both times, the answer was in what was really running, not in what I thought was running.&lt;/p&gt;

&lt;p&gt;If you want to see what the exports make, &lt;a href="https://tilzix.com/?utm_source=devto" rel="noopener noreferrer"&gt;Tilzix&lt;/a&gt; is free to try. Paste a website and get a carousel or video in about a minute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's a bug that only happened in production for you, while your laptop said everything was fine?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>javascript</category>
      <category>serverless</category>
      <category>debugging</category>
    </item>
    <item>
      <title>Foxit MCP Server: Let Your AI Agent Do the PDF Work.</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Tue, 24 Nov 2026 03:59:05 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/foxit-mcp-server-let-your-ai-agent-do-the-pdf-work-2e1g</link>
      <guid>https://dev.to/femi_akinyemi/foxit-mcp-server-let-your-ai-agent-do-the-pdf-work-2e1g</guid>
      <description>&lt;p&gt;Working with PDFs in code is mostly plumbing. You upload the file, start a job, poll until it's done, download the result, and deal with tokens along the way. Foxit has a guide that shows how to skip most of that by connecting your AI tool to their PDF tools through an MCP server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it covers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Foxit's open-source MCP server, which turns their cloud PDF API into 30+ tools an AI agent can call&lt;/li&gt;
&lt;li&gt;The tools, in seven groups: making PDFs from Word, Excel, PowerPoint, images, HTML or a web page; turning PDFs back into those formats; merging, splitting, compressing and watermarking; comparing and OCR; passwords and form data&lt;/li&gt;
&lt;li&gt;Step-by-step setup for Claude Desktop and VS Code. The same config works in Cursor and other MCP apps&lt;/li&gt;
&lt;li&gt;A longer example where an agent turns a Word contract into a PDF and sends it out for e-signature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Setup is small&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You make a free Foxit developer account (no card needed), get a client ID and secret, clone the repo, and add one entry to your tool's MCP config. After a restart you can type something like "convert this Word file to PDF and compress it", and the agent picks the right two tools on its own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who it's for&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developers building document workflows: contracts, reports, invoices, anything that ends up as a PDF. Also anyone who is tired of writing the same upload-and-poll code for every file job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I liked&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Claude Desktop asks before each tool runs and shows you the arguments, so you see exactly what the agent is about to do to your files. The guide calls this your audit point, and that matters when an agent is touching real documents.&lt;/p&gt;

&lt;p&gt;It's also clear about the limits. E-signature and document generation are separate Foxit APIs, not part of the MCP server. And the result of a full document analysis can be too big for the model, so you filter it before the model sees it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I'll use it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm building an app that makes image slides, and putting a set of images into one PDF is on my list. Turning each image into a PDF and merging them looks like the shortest way there, without adding a PDF library to my code.&lt;/p&gt;

&lt;p&gt;Read the full guide here: &lt;a href="https://developer-api.foxit.com/developer-blogs/use-cases-workflow-examples/automated-document-pipelines/foxit-mcp-server-ai-pdf-tools/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=influencer_distribution&amp;amp;utm_content=foxit_mcp_server" rel="noopener noreferrer"&gt;Foxit MCP Server: Give AI Agents Direct Access to 30+ PDF Tools&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>pdf</category>
      <category>productivity</category>
    </item>
    <item>
      <title>AI Wrote Most of My App. Real Users Found What It Missed.</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Fri, 20 Nov 2026 12:41:36 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/ai-wrote-most-of-my-app-real-users-found-what-it-missed-1fai</link>
      <guid>https://dev.to/femi_akinyemi/ai-wrote-most-of-my-app-real-users-found-what-it-missed-1fai</guid>
      <description>&lt;p&gt;I'm building &lt;a href="https://tilzix.com/?utm_source=devto" rel="noopener noreferrer"&gt;Tilzix&lt;/a&gt;, an app that turns your website or Instagram into carousels in your own brand. I use AI to write most of the code. I decide what gets built, test it, and own every bug that ships.&lt;/p&gt;

&lt;p&gt;It passed my tests. It worked on my phone. Then strangers started using it, and every week they found something the AI and I had both missed.&lt;/p&gt;

&lt;p&gt;Here are seven from the last two weeks, with the numbers. None of them were hard to fix. All of them were invisible until a real person hit them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. It guessed the brand's Instagram handle from the web address
&lt;/h2&gt;

&lt;p&gt;To put the right @handle on each slide, the code took the first part of the domain:&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="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"@"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fine for &lt;code&gt;glossier.com&lt;/code&gt;. Then a real customer pasted &lt;code&gt;pos.qwin.co.ke&lt;/code&gt;, and their carousel went out with &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/pos"&gt;@pos&lt;/a&gt;&lt;/strong&gt; on every slide. Another pasted a site hosted on Railway and got &lt;strong&gt;@railway&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I spotted it the same day in my analytics, emailed him, and fixed it that night.&lt;/p&gt;

&lt;p&gt;The fix: read the Instagram link the site actually has, and if there isn't one, take the brand's name, not the host's.&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="n"&gt;instagram&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;siteInstagram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;           &lt;span class="c1"&gt;// the link on their own page&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;instagram&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`@${instagram}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isHosted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`@${slug(brand.name)}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// web-clipscript.up.railway.app → @clipscript&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`@${mainName(host)}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;// pos.qwin.co.ke → @qwin&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one line looked fine to me too. Neither of us asked: what does a real domain look like?&lt;/p&gt;

&lt;h2&gt;
  
  
  2. "Works on five networks", followed by four
&lt;/h2&gt;

&lt;p&gt;A visitor made a carousel for a video tool. Slide two said &lt;strong&gt;"Works on five networks"&lt;/strong&gt; and listed YouTube, TikTok, Instagram, Facebook.&lt;/p&gt;

&lt;p&gt;Threads was missing. My slides allow four points, so the fifth was cut, and the headline still promised five.&lt;/p&gt;

&lt;p&gt;Now every list headline is checked. If it promises a number that doesn't match the points shown, the writer has to fix it, by combining points ("Facebook and Threads") or by dropping the number.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The "are you human" check inside Instagram's browser
&lt;/h2&gt;

&lt;p&gt;I use Cloudflare's bot check before anything costs money. In a normal browser it's invisible. Inside the Instagram and Facebook apps' built-in browsers it sometimes never loads.&lt;/p&gt;

&lt;p&gt;So my page told people to "tick the box". There was no box.&lt;/p&gt;

&lt;p&gt;One user in Lagos hit it four times in a row. The code gave up on the first error, even though Cloudflare retries by itself and often passes a second later. Now it waits for three errors, and in-app browsers get a hint to open the page in Safari or Chrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. 887 animations running at once on phones
&lt;/h2&gt;

&lt;p&gt;My home page shows live sample slides. Each one animates. I checked: &lt;strong&gt;887 animations&lt;/strong&gt; were running at the same time.&lt;/p&gt;

&lt;p&gt;That's a lot of work to ask of a phone, for slides nobody could even see.&lt;/p&gt;

&lt;p&gt;Now samples only run while they're on screen. It's about 9 animations most of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. My analytics counted Meta's robots as visitors
&lt;/h2&gt;

&lt;p&gt;I ran a tiny Instagram ad. Day one: 15 visitors. I was excited.&lt;/p&gt;

&lt;p&gt;Then I looked at them one by one. &lt;strong&gt;8 of the 15&lt;/strong&gt; arrived within the same minute, from Prineville, Forest City, Fort Worth and Luleå. Those are Meta's data centres, checking my link when the ad was approved.&lt;/p&gt;

&lt;p&gt;No dashboard told me that. I only saw it because I opened each visitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. One event that ate my analytics plan
&lt;/h2&gt;

&lt;p&gt;A "Love how it looks? Download it" prompt fired an analytics event when a carousel finished playing. The carousel loops. So it fired on every loop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;777 of 1,301&lt;/strong&gt; custom events in my account came from that one line, and the plan ran out.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. The fix that never shipped
&lt;/h2&gt;

&lt;p&gt;After fixing the &lt;a class="mentioned-user" href="https://dev.to/pos"&gt;@pos&lt;/a&gt; bug, a new user still got the wrong handle the next morning.&lt;/p&gt;

&lt;p&gt;The code was right. But reading websites runs on a separate AWS Lambda, and that hadn't been rebuilt in three weeks. My deploy only updated the main site. The fix was sitting in a file nobody was running.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AI writes the happy path.&lt;/strong&gt; It's very good at code that works for the example in front of it. It doesn't ask what a Kenyan domain looks like, or what happens inside Instagram's browser, or whether a loop fires an event a thousand times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tests didn't catch any of these.&lt;/strong&gt; Every one passed. The bugs were in assumptions, not logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watching real users did.&lt;/strong&gt; I read my analytics one visitor at a time. Not the totals. The timeline: they pasted this, waited this long, tapped that, left here. Almost every bug above came from one person's trail.&lt;/p&gt;

&lt;p&gt;So now my loop is: ship, watch five real people use it, fix what they found, repeat. AI makes the fixing fast. It doesn't make the finding happen.&lt;/p&gt;

&lt;p&gt;If you want to see what the app does now, it's at &lt;a href="https://tilzix.com/?utm_source=devto" rel="noopener noreferrer"&gt;tilzix.com&lt;/a&gt;: paste a website and you get a carousel in about a minute. Each of these was sorted within a day of someone finding it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's a bug AI wrote for you that only a real user found?&lt;/strong&gt; I'd love to hear yours.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>OAuth2 and JWT in Kotlin and Spring Boot: a beginner guide worth reading</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Tue, 17 Nov 2026 05:38:41 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/oauth2-and-jwt-in-kotlin-and-spring-boot-a-beginner-guide-worth-reading-3ldp</link>
      <guid>https://dev.to/femi_akinyemi/oauth2-and-jwt-in-kotlin-and-spring-boot-a-beginner-guide-worth-reading-3ldp</guid>
      <description>&lt;p&gt;I recently read a JetBrains tutorial on securing Kotlin and Spring Boot APIs with OAuth2 and JWT. If you're new to token auth, it's worth your time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it covers
&lt;/h2&gt;

&lt;p&gt;It starts with the basics. Authentication is who you are, and authorization is what you can do. It explains what's inside a JWT (header, payload, signature) and the four roles in OAuth2. One idea stuck with me: your API doesn't issue tokens. It only checks the ones it gets.&lt;/p&gt;

&lt;p&gt;Then you build a small document API in IntelliJ IDEA. It checks signed tokens, reads scopes, roles and permissions from them, and protects endpoints with &lt;code&gt;@PreAuthorize&lt;/code&gt;. I liked that the security rules sit in one place and not inside the controller code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who it's for
&lt;/h2&gt;

&lt;p&gt;It's a good place to start if you know a bit of Kotlin and Spring but have never set up token auth. You don't need a real login server to follow along. It uses local keys and points you to mock-oauth2-server for testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I'll use
&lt;/h2&gt;

&lt;p&gt;The issuer and audience check. It's easy to stop once the signature is valid. But a token signed by a server you trust can still be meant for a different app. Checking both keeps those tokens out of your API.&lt;/p&gt;

&lt;p&gt;The end has good advice too: keep tokens short-lived, plan for refresh and revocation, and don't use JWTs to store sessions.&lt;/p&gt;

&lt;p&gt;Read the full tutorial here: &lt;a href="https://blog.jetbrains.com/kotlin/2026/07/secure-your-apis-oauth2-and-jwt-for-beginners/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=influencer_distribution&amp;amp;utm_content=kotlin_oauth2_jwt" rel="noopener noreferrer"&gt;Secure Your APIs: OAuth2 and JWT for Beginners&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>springboot</category>
      <category>security</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My home page was running 887 animations at once on phones. The main fix was one line.</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Tue, 10 Nov 2026 13:40:51 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/my-home-page-was-running-887-animations-at-once-on-phones-the-main-fix-was-one-line-2ofo</link>
      <guid>https://dev.to/femi_akinyemi/my-home-page-was-running-887-animations-at-once-on-phones-the-main-fix-was-one-line-2ofo</guid>
      <description>&lt;p&gt;I build speed tools for a living. So this one stings a little.&lt;/p&gt;

&lt;p&gt;My product, &lt;a href="https://tilzix.com" rel="noopener noreferrer"&gt;Tilzix&lt;/a&gt;, turns a website into carousels for Instagram, TikTok and LinkedIn. The home page shows off the styles with real slides, drawn live in the browser, and most of them move. Text slides in, shapes float, one style has a row of little bulbs that blink like a theatre sign.&lt;/p&gt;

&lt;p&gt;On my laptop it looked great. On iPhones, the page kept reloading, then gave up with "A problem repeatedly occurred".&lt;/p&gt;

&lt;h2&gt;
  
  
  Counting what was running
&lt;/h2&gt;

&lt;p&gt;The first question was simple: how much is actually moving? The browser can tell you. Paste this into the console on any page:&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAnimations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;playState&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"running"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That counts every CSS animation and transition currently running.&lt;/p&gt;

&lt;p&gt;On my home page, after scrolling to the bottom on a phone-sized screen: &lt;strong&gt;887.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Almost all of it was slides I had already scrolled past, still animating where nobody could see them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug
&lt;/h2&gt;

&lt;p&gt;Each sample slide only mounted when it came near the screen. That's the usual lazy pattern, and I thought it was enough:&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="n"&gt;io&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IntersectionObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isIntersecting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setNear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;disconnect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rootMargin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100px"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the problem? It mounts once and never lets go. Scroll down the page and every slide you pass gets drawn, and then stays drawn, animating forever. The page only ever gets heavier.&lt;/p&gt;

&lt;p&gt;Lazy loading saves the first paint. It does nothing for the hundredth slide you scrolled past a minute ago.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Let the slide go when it leaves the screen:&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="n"&gt;io&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IntersectionObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setNear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isIntersecting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rootMargin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"40px 0px"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;near&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Slide&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a slide is only in the page while it's on screen or just about to be. Scroll past and it's removed, along with every animation inside it. Scroll back and it plays its entrance again, which looks deliberate rather than broken.&lt;/p&gt;

&lt;p&gt;I also tightened the margin from 100px to 40px, so fewer slides wait just off screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other culprit
&lt;/h2&gt;

&lt;p&gt;One style on its own accounted for about &lt;strong&gt;570&lt;/strong&gt; of those animations: the theatre-sign style, where every bulb is its own blinking animation. One slide in that style was on the home page, in the section about sizes.&lt;/p&gt;

&lt;p&gt;It's a fine style when you're looking at one slide. On a busy home page it was a lot of work for one piece. I swapped that section to a lighter style.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;At any moment while scrolling: about &lt;strong&gt;9&lt;/strong&gt; running animations, down from &lt;strong&gt;887&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;At the busiest point, with the style gallery on screen: about &lt;strong&gt;240&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The iPhone reloads stopped&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'm taking from it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Count, don't guess.&lt;/strong&gt; &lt;code&gt;document.getAnimations()&lt;/code&gt; is one line. Run it at the bottom of your longest page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mounting lazily isn't enough. Unmount too.&lt;/strong&gt; If it scrolled away, it shouldn't still be running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test on a real phone.&lt;/strong&gt; My laptop never showed a thing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I now run a script before every deploy that opens each page on a phone-sized screen, scrolls to the bottom and prints this count, so a page that creeps back up gets caught before it goes live.&lt;/p&gt;

&lt;p&gt;If you try the one-liner on your own site, I'd like to know what number you get.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why PageSpeed says reduce unused JavaScript</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Sat, 10 Oct 2026 10:51:36 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/why-pagespeed-says-reduce-unused-javascript-39kf</link>
      <guid>https://dev.to/femi_akinyemi/why-pagespeed-says-reduce-unused-javascript-39kf</guid>
      <description>&lt;p&gt;PageSpeed watched the page open. It listed scripts the browser downloaded and barely ran. That is the whole warning. Here is how to read the list without breaking the page.&lt;/p&gt;

&lt;p&gt;You already know the line. Reduce unused JavaScript. Under it, a stack of file addresses, and a size next to each one. The top file is the largest. It is easy to read that as “delete these.” That reading is how pages get broken.&lt;/p&gt;

&lt;p&gt;The line is still worth taking seriously. A phone on a slow connection has to fetch every one of those files before it can get on with the picture, the words, and the button the person came for. Code that never runs is still a download.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the line actually measured
&lt;/h2&gt;

&lt;p&gt;PageSpeed Insights loads one address, in a lab, the way a first visit might look on a phone. While that load is happening it keeps a record of which script code actually ran. Code that was downloaded and did not run on that pass is marked unused.&lt;/p&gt;

&lt;p&gt;That record stops when the page has settled. It does not sit there and use the site the way a person would. It does not open a menu, send a form, start a chat, or scroll to a map. Anything that waits for those moments can look unused and still be the reason the page works.&lt;/p&gt;

&lt;p&gt;So “unused” here means “not run during this one load.” It does not mean “safe to throw away,” and it does not mean “this file is why the site feels slow.” It means the browser fetched code it did not need yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a file that never ran still costs the visit
&lt;/h2&gt;

&lt;p&gt;The wait happens before the code runs. The phone has to ask for the file, receive it, and read it. A large script takes time on a weak connection even if most of the code sits idle after that. While that transfer is going on, the picture the person is waiting for is sharing the same connection.&lt;/p&gt;

&lt;p&gt;This is why a chat box you never opened can still show up on the list, and why the page can feel late before anyone taps anything. The file arrived. The feature did not. The visitor paid for both.&lt;/p&gt;

&lt;p&gt;A small unused file is rarely the story. PageSpeed puts the largest waste at the top for that reason. A tiny helper is not the same problem as a script hundreds of kilobytes long that came along for one button.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three kinds of files on the list
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Yours, and this page never needs it.&lt;/strong&gt; A slider script on a page with no slider. A booking script on a page with no booking. A theme file that loads on every page because that was easier than deciding. These are the ones worth removing from this page. The rest of the site can keep them where they are actually used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yours, and a person needs it a moment later.&lt;/strong&gt; The menu, the search box, the form, the gallery that opens on tap. PageSpeed did not tap. The file looks idle. Take it off the page and the first real visitor finds a dead control. If the file is huge, the useful question is whether that control can load when the person asks for it, not whether the control should disappear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Someone else’s file.&lt;/strong&gt; Ads, chat, a tag that loads other tags, a map, a review widget. The address is on their server. You cannot edit the file. You can take their tool off your page, or you can keep it because the tool is doing a job you want. Those are the only two honest choices. A speed plugin that claims to “fix unused JavaScript” often just delays these files. The download still happens. It happens a little later.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to leave alone
&lt;/h2&gt;

&lt;p&gt;Do not clear the list in one afternoon. I have watched people turn plugins off in a pile, run PageSpeed again, and treat whatever number comes back as proof. The score also moves when nothing changed. A real cut can look small on the grade, and a lucky second run can look like a victory. One file, then another look. I wrote about that wobble in &lt;a href="https://pafcore.site/why-your-lighthouse-score-changes" rel="noopener noreferrer"&gt;Why your Lighthouse score changes when you did nothing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Do not treat the homepage as the whole site. The homepage can be quiet while the page people actually use, a product, a booking form, a long post, pulls a much larger script. Test the address that felt slow.&lt;/p&gt;

&lt;p&gt;And do not assume this line is the main wait. A huge picture, or a server that is slow to answer, can be what people feel while this list sits underneath it. On a WordPress site those show up together, because themes and plugins are happy to add scripts to every page. I wrote that up in &lt;a href="https://pafcore.site/what-usually-slows-a-wordpress-site" rel="noopener noreferrer"&gt;What usually slows a WordPress site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to read one row
&lt;/h2&gt;

&lt;p&gt;Take the top row only.&lt;/p&gt;

&lt;p&gt;Read the address. If you recognise the name, a plugin, a theme, a tool you installed, you know who put it there. If the name is a hash of letters and you do not recognise it, it is often a file the site built, or a tag. The folder in the address usually gives it away: a plugin folder, a theme folder, or another company’s domain.&lt;/p&gt;

&lt;p&gt;Then ask one question. Does this page need this file before anyone taps? If the answer is no, that file does not belong on this load. If the answer is yes, leave it and look at the next row. If the answer is “only after they tap,” the file can wait for the tap, but only if you can make that change without losing the control.&lt;/p&gt;

&lt;p&gt;Chrome can show the same thing in more detail. Open the page, open the Coverage panel, and reload. It colours the code that ran and the code that did not. Use that when you already know the file and you want to see how much of it was idle. You do not need it to decide which row to open first. The top row is enough for that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to start
&lt;/h2&gt;

&lt;p&gt;Stay on the page that felt slow. Open the top file if it is yours. Leave the rest of the list until you know whether that file was the wait. If the top file belongs to a tool you do not care about, remove the tool, not five other plugins.&lt;/p&gt;

&lt;p&gt;Then run the check again on the same address. Read the new score next to how far the score moves when you change nothing. If the file is gone from the list and the page still works when you use it, that was the right cut. If the score jumped and the page feels the same, you measured noise.&lt;/p&gt;

&lt;p&gt;A free check on &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; is that first look without the long list. Paste the public address. No account. You get the score, how far that score moves when nothing changed, the slow file when it can be named, and a few of the problems. Sign in for the full report, including what to try. PageSpeed remains a good snapshot of the warning. Use it for the list. Use a named file when the list is too long to trust.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://pafcore.site/#scan" rel="noopener noreferrer"&gt;Check my site&lt;/a&gt;. Paste a public address. Free check. No account.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Why a website feels slow on a phone</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Sun, 27 Sep 2026 14:25:35 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/why-a-website-feels-slow-on-a-phone-1m1f</link>
      <guid>https://dev.to/femi_akinyemi/why-a-website-feels-slow-on-a-phone-1m1f</guid>
      <description>&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5bithy0zelmle712wshr.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5bithy0zelmle712wshr.png" alt="Same website: score 91 on a computer and 38 on a phone" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A website feels slow on a phone when the page asks a small screen and a weaker radio to do the same work your computer already finished. Large pictures. Busy scripts. Files the phone has not saved yet. You sit on fast wifi with a wide window. They sit on a phone. They feel a blank screen, a late picture, or taps that do nothing.&lt;/p&gt;

&lt;p&gt;This is common. It is not a mystery. You checked the site on your computer and it felt fine. A client or a friend opened it on a phone and said it was late. Both can be true.&lt;/p&gt;

&lt;p&gt;This piece is the plain version of that gap, and a free way to check the page the way a visitor does. &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; loads a public URL like a slow phone. When it can, the report names the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  What people feel on a phone
&lt;/h2&gt;

&lt;p&gt;They do not talk about scores. They talk about the wait.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The screen stays blank after they tap the link.&lt;/li&gt;
&lt;li&gt;The first picture shows up late.&lt;/li&gt;
&lt;li&gt;Buttons ignore the first tap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those moments decide if they stay. A number on a lab report can miss them. A score is still useful. It is not the whole story. I wrote about that in &lt;a href="https://pafcore.site/why-a-performance-score-is-not-enough" rel="noopener noreferrer"&gt;Why a performance score is not enough&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why your computer hides the wait
&lt;/h2&gt;

&lt;p&gt;Your computer is a kind visit. A phone is a harder one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The screen is smaller, the file is not.&lt;/strong&gt; A large picture can look sharp on your computer. On a phone it is often bigger than the space it fills. The phone still downloads the whole file. The visitor waits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The radio is weaker.&lt;/strong&gt; Home wifi is usually fast. A phone on mobile data is not. The same scripts and pictures take longer to arrive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You already had the files.&lt;/strong&gt; You open the site every day. Your computer saved pictures and scripts from last time. A new visitor starts from scratch. Their first load is the one that matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The page stays busy.&lt;/strong&gt; Chat widgets, booking tools, and tracking scripts keep the page working after it looks ready. On a phone that extra work shows up as taps that do nothing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep it honest: a phone is not always slower. A lean page can feel sharp on both. Guessing which file hurt wastes a day. Measure the page the way a visitor opens it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why the usual check misses it
&lt;/h2&gt;

&lt;p&gt;People test on the same computer they build on. Fast wifi. A wide window. Files already saved. The page feels fine. They stop.&lt;/p&gt;

&lt;p&gt;Google PageSpeed Insights is useful. It can show a phone view. Many people still paste once, glance at the number, and close the tab. A single run also wobbles. The number moves even when you changed nothing. See &lt;a href="https://pafcore.site/why-your-lighthouse-score-changes" rel="noopener noreferrer"&gt;Why your Lighthouse score changes when you did nothing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Home can look fine on a phone too. A product page or checkout can still wait. That is a different trap. I wrote it up in &lt;a href="https://pafcore.site/a-fast-homepage-can-still-hide-a-slow-site" rel="noopener noreferrer"&gt;A fast homepage can still hide a slow site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a useful phone check does
&lt;/h2&gt;

&lt;p&gt;A useful check should do four simple jobs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load the page like a slow phone, not like your computer.&lt;/li&gt;
&lt;li&gt;Run it more than once so you see a middle score, not one lucky result.&lt;/li&gt;
&lt;li&gt;Say what the person felt: blank screen, late picture, taps ignored.&lt;/li&gt;
&lt;li&gt;Name the slow file when the measurement can find it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is what &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; is built for. Paste a public URL. You get a free report. No signup. Three runs. A middle score. The quiet gap. The file when we can see it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check a page today
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Pick a real page. The home page, or a page people pay on.&lt;/li&gt;
&lt;li&gt;Open it once on your phone on mobile data. Notice the feel.&lt;/li&gt;
&lt;li&gt;Paste the full address at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Read the middle score first. Then open the top finding. If a file is named, start there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the live public URL. A page behind a login will not load the same way for a free public check. Start with what visitors already see.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you send sites to clients
&lt;/h2&gt;

&lt;p&gt;Clients live on a phone. You live on a computer. That is how arguments start. “It feels fine here.” “It feels late to me.”&lt;/p&gt;

&lt;p&gt;Send a report that names the feel and the file. Talk in plain words. What they saw. Which file hurt. What you will change next. Run one quiet check after the fix so you do not celebrate noise.&lt;/p&gt;

&lt;p&gt;If you manage many sites and need schedules, that is &lt;a href="https://pafcore.site/pro" rel="noopener noreferrer"&gt;Pro Watch&lt;/a&gt;. The free report stays free for a one off paste.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is my website slow on a phone but fine on my computer?
&lt;/h3&gt;

&lt;p&gt;Your computer has a wide screen, fast wifi, and files already saved from the last visit. A phone has a smaller screen, a weaker radio, and often starts from scratch. The same large picture and busy scripts cost more there. People feel a blank screen, a late picture, or taps that do nothing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I test website speed on a phone?
&lt;/h3&gt;

&lt;p&gt;Yes. Most visitors use a phone. A check on your computer can hide the wait they feel. Use a phone on mobile data, or a report that loads the page like a slow phone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does a high score on my computer mean the site is fast?
&lt;/h3&gt;

&lt;p&gt;No. A high score on a computer only describes that visit. The same page can feel late on a phone. Check the page the way a visitor opens it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does PafCore test on a phone?
&lt;/h3&gt;

&lt;p&gt;PafCore loads the public page three times on a slow phone connection. You get a middle score, how far that score moves on its own, and the slow file when the report can name it. Free. No signup.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://pafcore.site/#scan" rel="noopener noreferrer"&gt;Check my site&lt;/a&gt;. Paste a public URL. Free report. No signup.&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>ai</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>A fast homepage can still hide a slow site</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Fri, 25 Sep 2026 12:57:50 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/a-fast-homepage-can-still-hide-a-slow-site-32b4</link>
      <guid>https://dev.to/femi_akinyemi/a-fast-homepage-can-still-hide-a-slow-site-32b4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published at &lt;a href="https://pafcore.site/a-fast-homepage-can-still-hide-a-slow-site" rel="noopener noreferrer"&gt;pafcore.site/a-fast-homepage-can-still-hide-a-slow-site&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdyt85pzzjrgkfad4eboy.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdyt85pzzjrgkfad4eboy.png" alt="A shop homepage score of 88 next to a checkout score of 41" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A homepage score is the speed score for the home URL only. It is not a score for the whole site. I have seen a shop home sit near 88 and checkout sit near 41. Same host. Same theme. Different files. People still share the home screenshot and call the job done.&lt;/p&gt;

&lt;p&gt;This piece is the plain version of that mistake, and a free way to check a real page with &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt;. When we can, we name the slow file.&lt;/p&gt;

&lt;h2&gt;
  
  
  What people feel that you miss
&lt;/h2&gt;

&lt;p&gt;You live on the home page. Visitors do not.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They tap a product and wait on a blank screen.&lt;/li&gt;
&lt;li&gt;They reach checkout and the first tap does nothing.&lt;/li&gt;
&lt;li&gt;They open a campaign page and the big picture arrives late.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Home can feel fine. The wait shows up one click later. A score on home will not warn you. I wrote about why a number on its own is thin in &lt;a href="https://pafcore.site/why-a-performance-score-is-not-enough" rel="noopener noreferrer"&gt;Why a performance score is not enough&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the usual tools stop at one URL
&lt;/h2&gt;

&lt;p&gt;Google PageSpeed Insights checks the address you paste. One address. Lighthouse does the same. That is useful. It is also easy to misread.&lt;/p&gt;

&lt;p&gt;People paste the home page because it is the one they remember. The report looks serious. The number is high enough. They stop. The rest of the site never gets a turn.&lt;/p&gt;

&lt;p&gt;Each page loads its own pictures and scripts. A chat widget on a help page. A big gallery on a product page. A payment script on checkout. Home never asked for those files. So home never paid for them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep it honest: a strong homepage score is still good news. It is not a pass for the site. Treat it as one page you measured, then measure the next one people use.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Pages that hide the wait
&lt;/h2&gt;

&lt;p&gt;These are the ones I would open after home.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkout or a form.&lt;/strong&gt; Extra scripts. Extra fields. The page that should feel sharp often feels late.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A product page or a busy post.&lt;/strong&gt; Large pictures. Reviews. Related items. The template looks like home. The files do not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search results.&lt;/strong&gt; A list that builds itself after the page opens. The first screen can sit empty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A campaign landing page.&lt;/strong&gt; Heavy video. Heavy animation. Built for a click, then forgotten in the speed check.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft19tuam9c6cni83591u5.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft19tuam9c6cni83591u5.png" alt="Homepage score 88 beside checkout score 41" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Same site. Different wait. Start with the page that costs the most points.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What a useful check does
&lt;/h2&gt;

&lt;p&gt;A useful check does not stop at home.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run a page more than once so you see a middle score, not one lucky screenshot.&lt;/li&gt;
&lt;li&gt;Show how far the score moves on its own (the quiet gap).&lt;/li&gt;
&lt;li&gt;Name the slow file when the measurement can find it.&lt;/li&gt;
&lt;li&gt;Let you compare pages so the worst one is obvious.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is what &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; is built for. Paste a public URL. Free report. No signup. When we can see the cost, we name the file. When we cannot, we still tell you what to try first.&lt;/p&gt;

&lt;p&gt;You can also scan a whole site. Up to 20 pages. Worst first. That pack costs 20 credits and emails you when it finishes. Start with the free one page check if you have not used credits yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check more than your homepage
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Paste the home URL at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt;. Note the middle score.&lt;/li&gt;
&lt;li&gt;Open a page people actually use. Checkout. A product. A form. A busy post.&lt;/li&gt;
&lt;li&gt;Paste that full address. Wait for the middle score.&lt;/li&gt;
&lt;li&gt;Fix the worst page first. If a file is named, start there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the live public URL. A page behind a login will not load the same way for a free public check. Start with what visitors already see. Scores also move when you change nothing. Learn that quiet gap before you celebrate. See &lt;a href="https://pafcore.site/why-your-lighthouse-score-changes" rel="noopener noreferrer"&gt;Why your Lighthouse score changes when you did nothing&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  For freelancers and agencies
&lt;/h2&gt;

&lt;p&gt;Clients send a home screenshot. They ask if the site is fast. The honest answer is “I have not checked the page they pay on.”&lt;/p&gt;

&lt;p&gt;Send two links. Home and the page that matters. Talk in plain words: what the visitor felt, which file hurt, what you will fix next. A named file is easier to explain than a long tip list. More on that split in &lt;a href="https://pafcore.site/when-pagespeed-insights-is-not-enough" rel="noopener noreferrer"&gt;When PageSpeed Insights is enough (and when it is not)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PafCore can carry your name on the report when white label is on. If you manage many sites and need schedules, that is &lt;a href="https://pafcore.site/pro" rel="noopener noreferrer"&gt;Pro Watch&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does PageSpeed Insights check my whole website?
&lt;/h3&gt;

&lt;p&gt;No. It checks one URL at a time. A homepage score is not a score for every page on the site.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is my homepage fast but checkout is slow?
&lt;/h3&gt;

&lt;p&gt;Those pages load different files. Checkout often pulls extra scripts, forms, and pictures the home page never uses. Measure checkout on its own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I only test my homepage?
&lt;/h3&gt;

&lt;p&gt;No. Test the pages people actually use. Home, a product or post, and the page where they pay or send a form.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can PafCore scan a whole site?
&lt;/h3&gt;

&lt;p&gt;Yes. It can read up to 20 pages and show the worst first. That pack costs 20 credits and emails you when it finishes. A one page check is still free.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What usually slows a WordPress site</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Sun, 20 Sep 2026 11:29:18 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/what-usually-slows-a-wordpress-site-d02</link>
      <guid>https://dev.to/femi_akinyemi/what-usually-slows-a-wordpress-site-d02</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published at &lt;a href="https://pafcore.site/what-usually-slows-a-wordpress-site" rel="noopener noreferrer"&gt;pafcore.site/what-usually-slows-a-wordpress-site&lt;/a&gt;. Prefer the canonical link for sharing and SEO.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmqm31qsobx86oo7eiktw.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmqm31qsobx86oo7eiktw.png" alt="WordPress site speed: from a long tip list to a named file" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Blank screen. Late picture. Taps that feel ignored. Then a long tip list that still does not name the file. Here is the plain version, and a free way to find what to fix first.&lt;/p&gt;

&lt;p&gt;WordPress runs a large share of the public web. That success also means a lot of sites feel slow for the same reasons. Owners open Google PageSpeed Insights. They get a score and a scroll of advice. They still leave unsure what to change today.&lt;/p&gt;

&lt;p&gt;This piece is not a plugin hall of fame. It is what people usually feel, what a tip list misses, and how a free &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; report helps you name the slow file when it can.&lt;/p&gt;

&lt;h2&gt;
  
  
  What people feel first
&lt;/h2&gt;

&lt;p&gt;Before anyone talks about scores, visitors notice the site.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The screen stays blank longer than they expect.&lt;/li&gt;
&lt;li&gt;The big picture shows up late.&lt;/li&gt;
&lt;li&gt;Buttons and menus ignore the first tap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those moments matter more than a grade on a lab report. A score is useful. It is also incomplete on its own. I wrote about that gap in &lt;a href="https://pafcore.site/why-a-performance-score-is-not-enough" rel="noopener noreferrer"&gt;Why a performance score is not enough&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What usually slows WordPress
&lt;/h2&gt;

&lt;p&gt;Every site is different. Still, the same patterns show up again and again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large pictures.&lt;/strong&gt; Hero images, galleries, and blog photos that were never resized for the web. The browser waits. The visitor waits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heavy theme and plugin scripts.&lt;/strong&gt; Themes and plugins often load JavaScript and styles on every page, even when that page does not need them. One quiet plugin can cost more than the rest of the theme.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fonts.&lt;/strong&gt; Several font files, or fonts that block text until they finish loading. The page looks empty even when the words are already there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ads and embeds.&lt;/strong&gt; YouTube, maps, chat widgets, and ad scripts pull work from other servers. Your page waits on them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weak hosting.&lt;/strong&gt; Cheap shared hosting can make every request slower. It is real. It is not always the first place to look. Measure the page before you buy a bigger plan.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep it honest: none of these is always the villain. A lean plugin can be fine. A big image can be fine if it is the right size. Guessing wastes a week. Measuring names the file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why a tip list is hard to use
&lt;/h2&gt;

&lt;p&gt;PageSpeed Insights and Lighthouse are free and useful. The tip list is long on purpose. Many tips do not move the score much. Some are already fine for your page.&lt;/p&gt;

&lt;p&gt;People change three things. They run the check again. The number moves. They still cannot tell if the fix worked, or if the page just wobbles from one run to the next. That quiet swing is common. See &lt;a href="https://pafcore.site/why-your-lighthouse-score-changes" rel="noopener noreferrer"&gt;Why your Lighthouse score changes when you did nothing&lt;/a&gt; and &lt;a href="https://pafcore.site/why-faster-barely-moves-your-lighthouse-score" rel="noopener noreferrer"&gt;Why getting faster barely moves your Lighthouse score&lt;/a&gt;.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frp1tcrypfwsdcz7c1dks.png" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frp1tcrypfwsdcz7c1dks.png" alt="Side by side: a long tip list versus a named file and what to fix first" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Left: a scroll of tips. Right: a named file and a clear next step.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What a useful report does
&lt;/h2&gt;

&lt;p&gt;A useful speed report for WordPress should do four simple jobs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the page more than once so you see a middle score, not one lucky screenshot.&lt;/li&gt;
&lt;li&gt;Show how far the score moves on its own (the quiet gap).&lt;/li&gt;
&lt;li&gt;Say what to fix first by points, not by how scary the tip sounds.&lt;/li&gt;
&lt;li&gt;Name the slow file when the measurement can find it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is what &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;PafCore&lt;/a&gt; is built for. Paste a public WordPress URL. You get a free report. No signup. When we can see the cost, we name the file. When we cannot, we still tell you what to try first.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to try it on your WordPress site
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Pick a real page. The home page, or a busy post or product page.&lt;/li&gt;
&lt;li&gt;Paste the full address at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Read the middle score and the quiet gap first.&lt;/li&gt;
&lt;li&gt;Open the top finding. If a file is named, start there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the live public URL. A staging site behind a login will not load the same way for a free public check. Start with what visitors already see.&lt;/p&gt;

&lt;h2&gt;
  
  
  For freelancers and agencies
&lt;/h2&gt;

&lt;p&gt;You already sell WordPress speed work. Clients ask “did we get faster?” A long tip screenshot is hard to explain. A report that names a file is easier to send.&lt;/p&gt;

&lt;p&gt;PafCore can carry your name on the report when white label is on. Share the link. Talk in plain words: what the visitor felt, which file hurt, what you will fix next. Keep one quiet recheck after the fix so you do not celebrate noise.&lt;/p&gt;

&lt;p&gt;If you manage many sites and need schedules, that is &lt;a href="https://pafcore.site/pro" rel="noopener noreferrer"&gt;Pro Watch&lt;/a&gt;. The free report stays free for a one off paste.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is PageSpeed Insights enough for a WordPress site?
&lt;/h3&gt;

&lt;p&gt;It is a strong free snapshot of one URL. Use it to learn. When you need a named file, a middle score from a few runs, or a report for a client, add a clear report like PafCore. More on that split in &lt;a href="https://pafcore.site/when-pagespeed-insights-is-not-enough" rel="noopener noreferrer"&gt;When PageSpeed Insights is enough (and when it is not)&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is slow WordPress always a hosting problem?
&lt;/h3&gt;

&lt;p&gt;No. Weak hosting can hurt. Large pictures, heavy theme and plugin scripts, fonts, and embeds often cost more than people expect. Measure the page before you buy a bigger plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do plugins always make WordPress slow?
&lt;/h3&gt;

&lt;p&gt;Not always. Some plugins add little. Others load big scripts on every page. The honest answer is to measure and see which file costs the most points.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does PafCore replace WordPress speed plugins?
&lt;/h3&gt;

&lt;p&gt;No. Caching and image plugins can help. PafCore measures the live page, shows how far the score moves on its own, and names the slow file when it can. Use both: measure first, then choose a fix.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://pafcore.site/#scan" rel="noopener noreferrer"&gt;Check my site&lt;/a&gt; — paste a public WordPress URL. Free report. No signup.&lt;/p&gt;




</description>
    </item>
    <item>
      <title>When PageSpeed Insights is enough (and when it is not)</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Wed, 09 Sep 2026 10:31:43 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/when-pagespeed-insights-is-enough-and-when-it-is-not-64g</link>
      <guid>https://dev.to/femi_akinyemi/when-pagespeed-insights-is-enough-and-when-it-is-not-64g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;PageSpeed Insights is free. It is official. For one URL, right now, it is often the right tool.&lt;/p&gt;

&lt;p&gt;You paste a link. You wait. You get a Lighthouse performance score, lab timings, and field Core Web Vitals when Google has enough Chrome visits. That is a strong snapshot.&lt;/p&gt;

&lt;p&gt;A snapshot is not a watchman.&lt;/p&gt;

&lt;p&gt;This guide is for people who ship websites and still live in PageSpeed tabs. It says when that habit is fine, when it starts to fail you, and what to add without turning every check into a science project.&lt;/p&gt;

&lt;p&gt;By the end you will know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when a manual PageSpeed Insights run is enough
&lt;/li&gt;
&lt;li&gt;why one lucky score is a weak proof of a fix
&lt;/li&gt;
&lt;li&gt;when scheduled checks and alerts earn their keep
&lt;/li&gt;
&lt;li&gt;a simple hybrid you can run this week
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chrome and PageSpeed Insights stay in the mix. I also run a free three run check at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt; when you want the quiet swing and what to fix first without babysitting six tabs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What PageSpeed Insights is good at
&lt;/h2&gt;

&lt;p&gt;Use PageSpeed Insights when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you are learning Largest Contentful Paint, layout shift, and the performance score
&lt;/li&gt;
&lt;li&gt;you are checking one page before or after a change
&lt;/li&gt;
&lt;li&gt;you manage one or two sites and can afford to click by hand
&lt;/li&gt;
&lt;li&gt;you need field data from the Chrome UX Report on a busy enough URL
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For those jobs, do not add a tool for the sake of a tool. Open the page. Read the wait in seconds. Read the grade. Move on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a single run fools you
&lt;/h2&gt;

&lt;p&gt;Even on one site, a single PageSpeed Insights screenshot is a weak proof.&lt;/p&gt;

&lt;p&gt;Lab scores move when the code does not. Machine load, third party tags, and plain luck all show up. I have seen a quiet page score 60, then 51, then 57 with nothing deployed. Nine points of weather.&lt;/p&gt;

&lt;p&gt;So before you celebrate a fix:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run three quiet checks with no deploy. Learn the gap between best and worst.
&lt;/li&gt;
&lt;li&gt;Ship the change. Run three more.
&lt;/li&gt;
&lt;li&gt;Compare middle scores. Only call it a clear score win when the rise beats that quiet gap.
&lt;/li&gt;
&lt;li&gt;Write the wait you meant to fix in seconds next to the grade.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That habit works in Chrome DevTools, in PageSpeed Insights, or in a free three run report. Same idea. More than one sample. Seconds and score together.&lt;/p&gt;

&lt;p&gt;I wrote the full quiet gap steps in &lt;a href="https://pafcore.site/why-your-lighthouse-score-changes" rel="noopener noreferrer"&gt;Why your Lighthouse score changes when you did nothing&lt;/a&gt;. Read that when the number moves with no deploy.&lt;/p&gt;

&lt;p&gt;A real wait can also drop while the Lighthouse performance score barely moves. That is the scoring curve, not a broken tool. See &lt;a href="https://pafcore.site/why-faster-barely-moves-your-lighthouse-score" rel="noopener noreferrer"&gt;Why getting faster barely moves your Lighthouse score&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Manual checks fail you twice: at scale, and when you trust one lucky run.&lt;/p&gt;

&lt;h2&gt;
  
  
  When manual checks stop being enough
&lt;/h2&gt;

&lt;p&gt;You have crossed the line when one or more of these are true.&lt;/p&gt;

&lt;h3&gt;
  
  
  You watch more than a handful of pages
&lt;/h3&gt;

&lt;p&gt;Ten sites, a few key URLs each, mobile and desktop: that is a long afternoon of paste, wait, copy, switch. By the time you finish, the first numbers are stale. Miss a week and you have no recent trail when a client asks why search or speed felt worse.&lt;/p&gt;

&lt;h3&gt;
  
  
  A deploy can break speed overnight
&lt;/h3&gt;

&lt;p&gt;A new script, a heavier hero image, a font change. With only weekly PageSpeed Insights checks, you may learn on Friday. Or when the client calls. Scheduled lab checks (daily, or hourly on a few critical pages) shorten that blind spot. An alert should find you, not the other way around.&lt;/p&gt;

&lt;h3&gt;
  
  
  You need history, not only today’s screenshot
&lt;/h3&gt;

&lt;p&gt;PageSpeed Insights does not keep your before and after for you. Trend lines, month to month notes, and “this page got worse after Tuesday’s release” need storage. Screenshots in a folder do not scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  You need budgets and alerts
&lt;/h3&gt;

&lt;p&gt;“LCP should stay under 2.5 seconds on mobile home” is a budget. PageSpeed Insights will not email you when you cross it. A watch with a threshold will.&lt;/p&gt;

&lt;h3&gt;
  
  
  You need something a client can read
&lt;/h3&gt;

&lt;p&gt;Raw PageSpeed output is for builders. Clients want a short story: what got better, what still hurts, what you will do next. That story is easier when history and middle scores already exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  A plain comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Need&lt;/th&gt;
&lt;th&gt;PageSpeed Insights&lt;/th&gt;
&lt;th&gt;Scheduled checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One URL, right now&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mobile and desktop&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lab score and timings&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Field Core Web Vitals when available&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Sometimes (depends on the tool)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Many sites without tab hell&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Daily or hourly runs&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;History and trends&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Budgets and alerts&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Honest before / after (more than one run)&lt;/td&gt;
&lt;td&gt;You must do it by hand&lt;/td&gt;
&lt;td&gt;Still your job to demand it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same Lighthouse family of lab maths in many tools. The workflow is what changes. Scheduling does not make a single run more truthful. It makes misses rarer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use both. Split the jobs.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PageSpeed Insights or Chrome&lt;/strong&gt; for learning, quick peeks, and one off audits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three quiet runs&lt;/strong&gt; (by hand or a free report) whenever you claim a fix worked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduled Watch&lt;/strong&gt; when pages matter every week: home, pricing, checkout, key landing pages. Prove you own the domain. Set a budget. Let email or a webhook tap you when the score or a wait crosses the line.&lt;/p&gt;

&lt;p&gt;That is the hybrid. Not “throw away PageSpeed Insights.” Not “buy a dashboard and stop thinking.”&lt;/p&gt;

&lt;h2&gt;
  
  
  A week one checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;List the pages that would hurt if they got slow (home, money pages, signup).
&lt;/li&gt;
&lt;li&gt;For each, run three quiet mobile checks once. Write the gap and the middle score.
&lt;/li&gt;
&lt;li&gt;Keep using PageSpeed Insights for random questions.
&lt;/li&gt;
&lt;li&gt;Put the money pages on a schedule if you already juggle more than a few sites, or if a bad deploy would cost you a client call.
&lt;/li&gt;
&lt;li&gt;After the next speed fix, compare middle scores to the quiet gap, and write Largest Contentful Paint (or your target wait) in seconds.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want the three run spread and “what to fix first” in one paste, use &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt;. If you want daily or hourly checks, history, and alerts on pages you own, that is &lt;a href="https://pafcore.site/pro" rel="noopener noreferrer"&gt;Pro Watch&lt;/a&gt; at $19/mo. Credits on the site buy lab checks on a report. Watch runs are separate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;PageSpeed Insights is enough when you need a clear snapshot of one URL. It is not enough when you manage many pages, when you must catch a bad deploy fast, or when you confuse one lucky grade with proof.&lt;/p&gt;

&lt;p&gt;Automate the watch. Keep the honest measure. Talk in seconds and in scores. That mix scales better than living in twenty PageSpeed tabs, and it stays truer than a dashboard that only stores one run a day.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;When is PageSpeed Insights enough?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
One or two sites, learning the metrics, or a one off audit. Once you cannot keep up by hand, or once a missed week would embarrass you, add schedules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a scheduled tool use different maths than PageSpeed Insights?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Many lab tools sit on the same Lighthouse style checks. Field Core Web Vitals still come from real Chrome visits over time. Do not expect one lab run to match Search Console the same afternoon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why three runs if I already have daily monitoring?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Daily monitoring catches surprise drops. Three runs answer “did this fix beat the quiet weather?” You still need both ideas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I keep PageSpeed Insights for some clients?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Yes. Low stakes pages stay manual. High stakes pages get schedules, budgets, and a quiet gap written down once.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why your Lighthouse score changes when you did nothing</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Mon, 07 Sep 2026 06:10:41 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/why-your-lighthouse-score-changes-when-you-did-nothing-1d8e</link>
      <guid>https://dev.to/femi_akinyemi/why-your-lighthouse-score-changes-when-you-did-nothing-1d8e</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you ship websites for a living, you have seen this.&lt;/p&gt;

&lt;p&gt;You change one thing on a page. You open Chrome, run Lighthouse, and the performance score goes up a few points. You take a screenshot. You tell the team the fix worked.&lt;/p&gt;

&lt;p&gt;Later the same day you run the same URL again. No new deploy. The score drops. Sometimes it drops below where you started.&lt;/p&gt;

&lt;p&gt;That is not you failing at your job. Lab scores move even when the code does not. CPU load, network jitter, third party tags, and plain luck all show up in a single run. One number is a sample. It is not a verdict.&lt;/p&gt;

&lt;p&gt;This article gives you a short, repeatable way to read that movement so you stop celebrating noise. By the end you will know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;why a quiet page can still swing several points &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;how to measure that swing in Chrome in about fifteen minutes  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when a &lt;code&gt;fix&lt;/code&gt; is real enough to put in a pull request  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;how to talk about wins without overselling the score  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chrome DevTools is enough for every step. I also built a free three run check at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt; when you want that quiet gap without running Lighthouse by hand. The habit below is the same either way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the number moves
&lt;/h2&gt;

&lt;p&gt;Lighthouse loads your page in a controlled browser with throttling. That setup is useful because it is harsh and repeatable enough to compare days. It is not a perfect copy of every visitor.&lt;/p&gt;

&lt;p&gt;Small differences stack up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the machine was busier on one run
&lt;/li&gt;
&lt;li&gt;a third party script answered slower
&lt;/li&gt;
&lt;li&gt;an image raced and won or lost the “largest content” slot
&lt;/li&gt;
&lt;li&gt;the score itself sits on a curve, so the same time change is worth different points at different speeds
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So two runs of an untouched page can land far apart. I have seen a public site score 60, then 51, then 57 with nothing deployed in between. Nine points of weather.&lt;/p&gt;

&lt;p&gt;If you only look at the first run after a deploy, you will misread luck as skill.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you will set up
&lt;/h2&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome
&lt;/li&gt;
&lt;li&gt;the live URL (or a stable preview URL)
&lt;/li&gt;
&lt;li&gt;a note app or the PR description
&lt;/li&gt;
&lt;li&gt;the same Lighthouse mode every time (mobile or desktop). Pick one and keep it
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Turn extensions off, or use a clean window. Do not scroll or click while the audit runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1. Measure a quiet page
&lt;/h2&gt;

&lt;p&gt;Run Lighthouse three times on the same URL. Do not deploy between runs. Write down the three performance scores.&lt;/p&gt;

&lt;p&gt;Find the highest and the lowest. Subtract. That gap is how far this page already moves when you change nothing.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Gap: &lt;strong&gt;9 points&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Some pages only move two or three points. Some move more. You cannot guess your gap. You measure it once per important page (home, pricing, checkout) and you refresh it when the page shape changes a lot.&lt;/p&gt;

&lt;p&gt;Doing those three quiet runs by hand is boring, which is why people skip it. I got tired of skipping it on client work, so I built a free report at &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt; that loads the page three times and shows how far the score moves on its own. Use Chrome if you want full control. Use that report if you want the quiet gap filled in for you. Either way, the idea is the same: learn the swing before you celebrate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2. Ship the change, then measure again
&lt;/h2&gt;

&lt;p&gt;Deploy your fix. Run Lighthouse three more times with the same settings.&lt;/p&gt;

&lt;p&gt;Sort each set of three scores and take the &lt;strong&gt;middle&lt;/strong&gt; one. Compare middle after to middle before.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clear win:&lt;/strong&gt; the middle score rose by &lt;strong&gt;more than&lt;/strong&gt; the quiet gap.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Not clear yet:&lt;/strong&gt; the rise is smaller than the gap.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;No win:&lt;/strong&gt; the middle score did not rise, or it fell.&lt;/p&gt;

&lt;p&gt;A four point bump on a page with a nine point quiet gap is not a story. It is still inside the swing you already saw.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3. Write the slow thing in seconds
&lt;/h2&gt;

&lt;p&gt;The score is curved. A real wait can get better while the grade barely moves, especially on a slow page.&lt;/p&gt;

&lt;p&gt;In the same note, track the metric you meant to fix:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Before (middle of 3)&lt;/th&gt;
&lt;th&gt;After (middle of 3)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Performance score&lt;/td&gt;
&lt;td&gt;56&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Biggest picture time&lt;/td&gt;
&lt;td&gt;4.8s&lt;/td&gt;
&lt;td&gt;3.1s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now you can say something honest: visitors should feel a clearer first picture, and the score is still noisy. That is better than claiming “we gained four points” when those four points never cleared the quiet gap.&lt;/p&gt;

&lt;p&gt;If both the score and the target time sit inside the quiet swing, do not call it a performance win. Keep the change if the code is cleaner. Leave the victory lap for later.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4. Do not drown in the tip list
&lt;/h2&gt;

&lt;p&gt;Lighthouse will hand you a long list of opportunities. Most rows are not direct score inputs. The grade comes from a small set of lab metrics (largest content paint, blocking time, layout shift, first content paint, speed index, and similar). Tips about unused script or cache headers can still help people. They only raise the grade if they improve one of those metrics.&lt;/p&gt;

&lt;p&gt;Before you put a tip on the sprint board, answer out loud:&lt;/p&gt;

&lt;p&gt;“If this works, which score metric gets better?”&lt;/p&gt;

&lt;p&gt;No answer means cleanup. Cleanup is fine. Cleanup is not a score promise.&lt;/p&gt;

&lt;p&gt;If two tips are the same heavy image with two labels, fix the image once. Do not add imaginary points from both rows.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5. Put numbers in the pull request
&lt;/h2&gt;

&lt;p&gt;Paste something like this so review stays calm:&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="nc"&gt;Lighthouse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;same&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;three&lt;/span&gt; &lt;span class="n"&gt;runs&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;three&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="nc"&gt;Quiet&lt;/span&gt; &lt;span class="n"&gt;gap&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="n"&gt;minus&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="n"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="nc"&gt;Middle&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="nc"&gt;Middle&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="nc"&gt;Target&lt;/span&gt; &lt;span class="n"&gt;wait&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="nc"&gt;Clear&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;yes&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;sure&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One screenshot of a lucky run starts arguments. This block ends most of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get from this habit
&lt;/h2&gt;

&lt;p&gt;After you use this a few times you will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stop treating a single Lighthouse score as proof.
&lt;/li&gt;
&lt;li&gt;Know your page’s quiet gap, so small bumps stop wasting the team’s week.
&lt;/li&gt;
&lt;li&gt;Separate &lt;code&gt;score went up&lt;/code&gt; from &lt;code&gt;the wait got better,&lt;/code&gt; and report both.
&lt;/li&gt;
&lt;li&gt;Pick tip list work that maps to a real metric, instead of boiling the ocean.
&lt;/li&gt;
&lt;li&gt;Leave a PR trail other people can trust.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is the value. Not a new theory. A filter for what you already run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Your Lighthouse score changes when you did nothing because a lab run is noisy. That is expected.&lt;/p&gt;

&lt;p&gt;Measure three quiet runs. Learn the gap. Only call a fix a win when the new middle score beats that gap, and check the wait in seconds too. Treat the long tip list as optional until it names a metric you can move.&lt;/p&gt;

&lt;p&gt;Do this on your important pages once, then again after real releases. You will ship fewer fake wins and sleep better after you post the screenshot.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://pafcore.site" rel="noopener noreferrer"&gt;pafcore.site&lt;/a&gt; for the days when I did not want to babysit six Lighthouse runs myself. &lt;/p&gt;

&lt;p&gt;Paste a public URL, get the three run spread, see what to try first by points, and keep the habit from this article either way. &lt;/p&gt;

&lt;p&gt;Chrome alone still works. The site is there when you want the quiet check done in one pass.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>frontend</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What AI Still Misses in Production Next.js Apps</title>
      <dc:creator>Femi Akinyemi</dc:creator>
      <pubDate>Mon, 22 Jun 2026 07:10:47 +0000</pubDate>
      <link>https://dev.to/femi_akinyemi/what-ai-still-misses-in-production-nextjs-apps-pcg</link>
      <guid>https://dev.to/femi_akinyemi/what-ai-still-misses-in-production-nextjs-apps-pcg</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You ask AI to fix a fetch. It does. Types pass. The component renders. You push.&lt;/p&gt;

&lt;p&gt;Then dev crawls to a stop. Or prod serves a blank page. Or GitHub says conflict on a file you never touched. The model did its job inside the file. It did not see the repo around it.&lt;/p&gt;

&lt;p&gt;That gap is where most Next.js pain actually lives. Not broken JSX. Wrong root folder. Wrong env layer. Wrong deploy model. Stale git ref on the remote.&lt;/p&gt;

&lt;p&gt;This list is the stuff that keeps surviving AI refactors, green CI, and clean local merges.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Next dev watching the whole monorepo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app sits inside a bigger repo. There is another lockfile above it. You run &lt;code&gt;next dev&lt;/code&gt;, see a warning about multiple lockfiles, and keep going.&lt;/p&gt;

&lt;p&gt;Compile gets slow. CPU stays high. Sometimes the machine feels stuck for no clear reason. AI will suggest faster imports or smaller components. It will not notice Next is indexing the wrong tree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pin Turbopack to the app folder in next.config.ts:&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="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:path"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;fileURLToPath&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:url"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;appRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fileURLToPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;turbopack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;appRoot&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This applies to certain monorepo/workspace setups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is not the solution for every slow Next.js dev environment.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If that lockfile warning shows up, treat it as a bug, not noise.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Putting server secrets in &lt;code&gt;NEXT_PUBLIC_*&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI puts API URLs and tokens in &lt;code&gt;NEXT_PUBLIC_*&lt;/code&gt; because that is what client fetch examples use. Those values ship in the browser bundle. Anyone can read them in the built JS.&lt;/p&gt;

&lt;p&gt;Or the opposite: server route handlers need an upstream URL that only exists as a public var pointing somewhere else. Local dev works with a hack. Prod does not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Split by runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Browser code → &lt;code&gt;NEXT_PUBLIC_*&lt;/code&gt; only&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Route handlers / server code → server env vars (no &lt;code&gt;NEXT_PUBLIC_ prefix&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Upstream URLs and service tokens stay on the server. Client calls your BFF or the public API surface. Never both through one env var.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. API address missing or duplicating &lt;code&gt;/api/v1&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One backend expects calls to &lt;code&gt;https://api.example.com&lt;/code&gt;. Another expects &lt;code&gt;https://api.example.com/api/v1&lt;/code&gt;. Your code adds paths on top of the base address. Get it wrong by one segment and every request &lt;code&gt;404s&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This often happens when you copy .env.local from another app in the same repo. AI copies the fetch code correctly. It does not check whether the base address matches this app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open that app's &lt;code&gt;.env.example&lt;/code&gt;. See exactly how it builds URLs. Match that. Do not assume all apps in one company use the same address format.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Adding server API files to an app that deploys as static &lt;code&gt;HTML&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some Next apps are built with output: &lt;code&gt;"export"&lt;/code&gt;. That means the output is plain &lt;code&gt;HTML&lt;/code&gt;, &lt;code&gt;CSS&lt;/code&gt;, and &lt;code&gt;JS&lt;/code&gt; files uploaded to static hosting (like S3 or Amplify static). There is no Node server running your app in production.&lt;/p&gt;

&lt;p&gt;You can add files under &lt;code&gt;app/api/&lt;/code&gt; and they may work in local dev. They will not exist after a static build. The hosting serves files, not your API routes.&lt;/p&gt;

&lt;p&gt;AI often suggests "add an API route to hide the token" without checking how the app is deployed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you deploy as static files, the browser calls your backend directly and your backend must allow that origin &lt;code&gt;(CORS)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you need a server middle layer to hide tokens, you cannot deploy as a pure static export. You need hosting that runs &lt;code&gt;Next.js&lt;/code&gt; server code.&lt;/p&gt;

&lt;p&gt;Pick one. Mixing both without knowing it is a common break.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Local proxy setup that does not exist in production&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In local dev, teams often add a proxy in next.config so calls to &lt;code&gt;/api/v1/...&lt;/code&gt; get forwarded to a real server. Same website address, no cross-origin browser errors. Works great on your machine.&lt;/p&gt;

&lt;p&gt;A static production build does not include that proxy. The browser still calls &lt;code&gt;/api/v1/...&lt;/code&gt; on your static site address. Those requests never reach your backend.&lt;/p&gt;

&lt;p&gt;AI adds the proxy config. It rarely asks how you deploy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use different setup for dev and prod:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dev: proxy in next.config if you want&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prod: full backend URL in env, &lt;code&gt;CORS&lt;/code&gt; enabled on the backend&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run next build the same way CI does before you call it done. next dev alone is not enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;6. Server-only code imported in a client component&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next has a hard line between server code and client code. Files marked "use client" run in the browser. Things like reading request headers or secret env vars only work on the server.&lt;/p&gt;

&lt;p&gt;One shared &lt;code&gt;lib/api.ts&lt;/code&gt; file often gets imported everywhere. AI merges duplicate files and accidentally puts server code inside a client component. Build fails or you get strange runtime errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;One for the browser (simple fetch, public env only)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One for the server (secret env, used only in app/api routes or server components)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it reads cookies, headers, or private env, it never goes in a "use client" file.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;7. Login token is valid but for the wrong app&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some apps check two things: is the user logged in, and does their role match this specific product. You paste a login token into .env.local. It is not expired. The app still sends you back to the login page.&lt;/p&gt;

&lt;p&gt;The token belongs to a different dashboard or role. AI tries to fix the redirect logic. The check is working. Your token is for the wrong app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure three things match: the role setting in env, the role inside the token, and what the app's auth guard expects. When testing locally, use a token created for this app specifically.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;8. Fake login still turned on while shipping real auth&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many teams add a dev-only flag that skips real login so they can build UI faster. Useful. Easy to forget about.&lt;/p&gt;

&lt;p&gt;You say auth is done. But callback, token refresh, sign out, and role redirect were never tested with real login. AI sees a user object in state and assumes auth works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use the skip-login flag only for UI work. Before merging: turn it off, log in for real, open a protected page, sign out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;9. Old dev server still running on the port&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You run pnpm dev again without closing the last one. Port &lt;code&gt;3000&lt;/code&gt; is busy. Next starts on &lt;code&gt;3001&lt;/code&gt;. You keep refreshing 3000 and see the wrong app or nothing useful.&lt;/p&gt;

&lt;p&gt;AI will debug your React code. It will not check which process owns the port.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&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="n"&gt;lsof&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Kill the old process. Start fresh. Confirm which port the terminal says before debugging anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;10. No conflict on your machine, conflict on GitHub&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You updated your branch with the latest main locally. Merge looks clean. The pull request on GitHub still shows conflicts.&lt;/p&gt;

&lt;p&gt;Your local branch and the copy on GitHub are not the same history anymore. GitHub compares the remote branch to main, not your rebased local copy.&lt;/p&gt;

&lt;p&gt;AI says "pull main again." You already did. On your machine only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After rebasing locally, update GitHub:&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="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;push&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;force&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lease&lt;/span&gt; &lt;span class="n"&gt;origin&lt;/span&gt; &lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;branch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Only use this when you intentionally rebased or rewrote branch history.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Check they match:&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="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="n"&gt;origin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HEAD&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No output means local and remote are in sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;11. Expired login token in your env file&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For local development, some apps read a login token from .env.local and attach it to server-side API calls. Tokens expire. Handlers return 401 Unauthorized. The UI shows empty data or error states.&lt;/p&gt;

&lt;p&gt;Looks like the API is broken. AI rewrites error handling. The token is just old.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Decode the token and check the expiry time. Get a fresh one from a real login. Treat dev tokens like passwords with an expiration date.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;12. Public env vars set after the build, not during it&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NEXT_PUBLIC_&lt;/code&gt; values are written into the JavaScript at build time.&lt;/p&gt;

&lt;p&gt;If you set them in your hosting dashboard after the build already ran, the live site still has the old values baked in.&lt;/p&gt;

&lt;p&gt;Works on your machine with .env.local. Wrong API address or app setting in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure public env vars exist before next build runs in CI. Some teams write a .env.production file in the build step. Check build logs, not just runtime settings in the host UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. Copied env from the wrong app in the same repo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two Next apps in one repo look similar. Same folders, same tools. Different env needs. Copy .env.local from one app into another.&lt;/p&gt;

&lt;p&gt;The shell loads. The first API call or redirect fails. AI assumes env is fine because the file is there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every app has its own .env.example. Start from that file every time.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Env&lt;/code&gt; is per app, not per repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;14. Login page and dashboard on the same local port&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Login usually lives on one app. The dashboard on another. In local dev that means different ports (for example &lt;code&gt;3001&lt;/code&gt; for login, &lt;code&gt;3000&lt;/code&gt; for dashboard).&lt;/p&gt;

&lt;p&gt;If both URLs in env point to the same port, redirects get confused. Loops, wrong landing page, sign out going nowhere useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Write down the flow: login address → callback → dashboard address.&lt;/p&gt;

&lt;p&gt;Set &lt;code&gt;env&lt;/code&gt; to match separate apps, even on localhost.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;15. Green code review, nobody ran a production build&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI fixed the component in the prompt. Types pass. Review looks good. Nobody ran a full production build with real login and a real API call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before merge:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;next dev starts without warnings&lt;/li&gt;
&lt;li&gt;next build passes with the same config CI uses&lt;/li&gt;
&lt;li&gt;One real login (skip-login flag off)&lt;/li&gt;
&lt;li&gt;One API call that returns real data&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;AI is strong inside a single file. It is weak on repo layout, env setup, static vs server deploy, and whether your GitHub branch matches your local branch.&lt;/p&gt;

&lt;p&gt;Those live outside the chat window. Check them yourself and a lot of "random" Next.js bugs stop being random.&lt;/p&gt;

&lt;h2&gt;
  
  
  Need Help With Your Next.js or AWS Project?
&lt;/h2&gt;

&lt;p&gt;Over the last 5+ years, I've helped build and maintain production systems used by businesses across different industries. If you're looking for help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js applications&lt;/li&gt;
&lt;li&gt;React architecture&lt;/li&gt;
&lt;li&gt;AWS deployments&lt;/li&gt;
&lt;li&gt;AI integrations&lt;/li&gt;
&lt;li&gt;Performance optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;feel free to reach out.&lt;/p&gt;

&lt;p&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/femi-akinyemi/" rel="noopener noreferrer"&gt;Femi Akinyemi&lt;/a&gt;&lt;br&gt;
DEV: &lt;a href="https://dev.to/femi_akinyemi"&gt;dev.to/femi_akinyemi&lt;/a&gt;&lt;br&gt;
Portfolio: &lt;a href="https://www.femiakinyemi.xyz/" rel="noopener noreferrer"&gt;Femi Akinyemi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>frontend</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
