<?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: golproductions</title>
    <description>The latest articles on DEV Community by golproductions (@golproductions).</description>
    <link>https://dev.to/golproductions</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%2F3985231%2Fbefc197f-9d44-4753-b7f3-559232f9df55.png</url>
      <title>DEV Community: golproductions</title>
      <link>https://dev.to/golproductions</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/golproductions"/>
    <language>en</language>
    <item>
      <title>Your AI Is Importing Packages That Don't Exist</title>
      <dc:creator>golproductions</dc:creator>
      <pubDate>Sun, 21 Jun 2026 18:06:54 +0000</pubDate>
      <link>https://dev.to/golproductions/your-ai-is-importing-packages-that-dont-exist-e5</link>
      <guid>https://dev.to/golproductions/your-ai-is-importing-packages-that-dont-exist-e5</guid>
      <description>&lt;p&gt;Every AI coding agent does this. It writes a line of code that looks perfect — clean syntax, reasonable logic, exactly what you asked for. Except the import at the top of the file references a package you've never installed. The code breaks the moment it runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem is structural, not behavioral
&lt;/h2&gt;

&lt;p&gt;When an AI model generates code, it draws from patterns in its training data. If it has seen &lt;code&gt;import cache from "express-redis-cache"&lt;/code&gt; used in thousands of codebases, it will suggest it in yours — regardless of whether that package is in your &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The model has no access to your dependency tree. It doesn't read your &lt;code&gt;node_modules&lt;/code&gt;. It doesn't know what's installed. It generates what looks right based on statistical patterns, not based on your project.&lt;/p&gt;

&lt;p&gt;This is not a bug in the model. It's a fundamental limitation. The model generates code in isolation from your project state.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this looks like in practice
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// AI writes this&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express-redis-cache&lt;/span&gt;&lt;span class="dl"&gt;"&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="nx"&gt;rateLimit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express-rate-limiter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;morgan&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;morgan-body&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Your package.json has none of these&lt;/span&gt;
&lt;span class="c1"&gt;// MODULE_NOT_FOUND: Cannot find module 'express-redis-cache'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The names sound right. They follow naming conventions. Some of them are real packages — just not ones you have installed. Others are completely invented. The model doesn't distinguish between the two.&lt;/p&gt;

&lt;p&gt;This is especially common when the AI is writing boilerplate, middleware chains, or utility code. These are the contexts where models have seen the widest variety of packages during training, so the pool of possible suggestions is deepest — and least likely to match your specific setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this costs more than you think
&lt;/h2&gt;

&lt;p&gt;A hallucinated import doesn't just fail once. Here's the chain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI writes a file with a wrong import&lt;/li&gt;
&lt;li&gt;You run the code (or your agent does)&lt;/li&gt;
&lt;li&gt;It crashes with MODULE_NOT_FOUND&lt;/li&gt;
&lt;li&gt;The AI sees the error and tries to fix it&lt;/li&gt;
&lt;li&gt;It either suggests installing the package (wrong fix) or rewrites the import to another package it thinks might work (another guess)&lt;/li&gt;
&lt;li&gt;The cycle repeats&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each retry is another inference call. The context window grows with each error. The cost compounds. A single hallucinated import can trigger 3-5 retries before the AI either finds the right package or you intervene manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: verify imports against your actual project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.golproductions.com/check.html" rel="noopener noreferrer"&gt;Check&lt;/a&gt; reads your actual &lt;code&gt;package.json&lt;/code&gt; after every file write. Every &lt;code&gt;import&lt;/code&gt; and &lt;code&gt;require()&lt;/code&gt; in the generated code is compared against your real dependencies. If the AI wrote an import for a package you don't have, it gets flagged before the code ever runs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @golproductions/check &lt;span class="nt"&gt;--install&lt;/span&gt; your_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One command. The AI keeps writing code. Check keeps verifying it matches your project. No AI inside Check — it's deterministic. It reads your dependency list and compares. Same input, same output, every time.&lt;/p&gt;

&lt;p&gt;Works with Claude Code, Cursor, and Antigravity. 120 free checks on signup. $0.0068 AUD per check after that. No subscription. Credits never expire.&lt;/p&gt;




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

&lt;p&gt;&lt;strong&gt;Why does AI hallucinate imports?&lt;/strong&gt;&lt;br&gt;
AI models generate code based on patterns from training data, not your actual project. They don't have access to your package.json or node_modules. If the model has seen a package used in similar contexts during training, it will suggest it — whether you have it installed or not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I stop AI from importing packages I don't have?&lt;/strong&gt;&lt;br&gt;
Install Check (&lt;code&gt;npx @golproductions/check --install your_key&lt;/code&gt;). After every file write, Check compares the imports in the generated code against your actual package.json dependencies. If the AI wrote an import for a package you don't have, it gets flagged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when AI imports a non-existent package?&lt;/strong&gt;&lt;br&gt;
If the code reaches production, it crashes at runtime with MODULE_NOT_FOUND. If caught during development, you waste time debugging why the AI's suggestion doesn't work and manually fixing the imports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Check work with TypeScript imports?&lt;/strong&gt;&lt;br&gt;
Yes. Check validates imports in JavaScript, TypeScript, JSX, TSX, and all Node.js module formats (ESM and CommonJS). It compares every import and require() against your actual dependencies.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>security</category>
      <category>productivity</category>
    </item>
    <item>
      <title>We just release Check. 

A preflight to check if a command will run prior to running it.

$0.04 AUD per call, served from cloud, fully accessible via API.

https://www.golproductions.com/check</title>
      <dc:creator>golproductions</dc:creator>
      <pubDate>Mon, 15 Jun 2026 09:51:35 +0000</pubDate>
      <link>https://dev.to/golproductions/we-just-release-check-a-preflight-to-check-if-a-command-will-run-prior-to-running-it-004-31b0</link>
      <guid>https://dev.to/golproductions/we-just-release-check-a-preflight-to-check-if-a-command-will-run-prior-to-running-it-004-31b0</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.golproductions.com/check" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.golproductions.com%2Flogo.png" height="500" class="m-0" width="500"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.golproductions.com/check" rel="noopener noreferrer" class="c-link"&gt;
            Check - GOL Productions
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Check if a command is runnable before you run it. One word back: runnable or invalid.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.golproductions.com%2Fgol-icon-v5.ico" width="" height=""&gt;
          golproductions.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
