<?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>Forem: Pablo Nevares</title>
    <description>The latest articles on Forem by Pablo Nevares (@pnevares).</description>
    <link>https://forem.com/pnevares</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F88061%2Fc4e72080-31c8-4724-957e-65f5122c4df7.jpeg</url>
      <title>Forem: Pablo Nevares</title>
      <link>https://forem.com/pnevares</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pnevares"/>
    <language>en</language>
    <item>
      <title>Webpack isn't noticing your file changes. Did you do something wrong?</title>
      <dc:creator>Pablo Nevares</dc:creator>
      <pubDate>Fri, 25 Oct 2019 06:02:17 +0000</pubDate>
      <link>https://forem.com/pnevares/webpack-isn-t-noticing-your-file-changes-did-you-do-something-wrong-34dc</link>
      <guid>https://forem.com/pnevares/webpack-isn-t-noticing-your-file-changes-did-you-do-something-wrong-34dc</guid>
      <description>&lt;p&gt;Have you ever felt personally attacked by Webpack, or ESlint, or Visual Studio Code? Not in the normal, every day ways, but in the special way where it's telling you "this file can't be parsed" but you can see with your own, human eyes that the error is just plain wrong?&lt;/p&gt;

&lt;p&gt;It seems like this happens a different way every time. Last week, maybe it was a merge conflict.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt; my good, new code
&lt;span class="gh"&gt;=======
&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt; somebody else's bad, new code
&lt;span class="gi"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; master
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You resolved it, and saved the file, and can see everything is normal now! But...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  1:2  error  Parsing error: Unexpected token

&amp;gt; 1 | &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's not true! I solved the problem! You try canceling and re-running &lt;code&gt;npm start&lt;/code&gt;. You try restarting your terminal, or VS Code, or your entire computer. This makes no sense!&lt;/p&gt;

&lt;p&gt;Your neighbor tells you: "Oh yeah, sometimes I have to delete my node_modules, and &lt;code&gt;npm install&lt;/code&gt;. Or sometimes I have to delete the project, and &lt;code&gt;git clone&lt;/code&gt; it again." That sucks, you say. That's not a good answer! What's the real problem behind the scenes?&lt;/p&gt;

&lt;p&gt;You're suffering from a stale file cache. And I have great news: it's easy to diagnose and even easier to resolve. Don't delete your node_modules directory! ESPECIALLY don't delete your project! Delete &lt;code&gt;node_modules/.cache&lt;/code&gt;. Run &lt;code&gt;npm start&lt;/code&gt; again. Check. Is everything back to normal?&lt;/p&gt;

&lt;p&gt;At the root of this madness-inducing bug is the &lt;a href="https://www.npmjs.com/package/find-cache-dir"&gt;find-cache-dir&lt;/a&gt; package. It's a great tool: multiple projects use it to find and use the &lt;code&gt;node_modules/.cache&lt;/code&gt; directory to store temporary cache files for performance reasons. And it's great when it works, which is most of the time. babel-loader uses it, so does eslint-loader. These are the two I've seen cause similar errors and confusion in the past, but I'm sure there are others.&lt;/p&gt;

&lt;p&gt;But sometimes, when you make an unexpected change, the cache gets confused. You fixed the git merge conflict and removed those &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;/code&gt; tags, but maybe the file that imported the conflicted file is still using the stale, cached copy. It's okay, deleting the &lt;code&gt;node_modules/.cache&lt;/code&gt; directory will make any packages using it read everything fresh the next time they run. And it'll solve this issue, and you can continue being productive.&lt;/p&gt;

&lt;p&gt;If you find this is happening often in your project, you can add an npm script to make this a quicker fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;   "scripts": {
     "start": "react-scripts start",
     "build": "react-scripts build",
&lt;span class="gi"&gt;+    "nuke:cache": "rm -rf ./node_modules/.cache",
&lt;/span&gt;     "test": "react-scripts test",
     "eject": "react-scripts eject"
   },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also make the new script cross-platform. Run &lt;code&gt;npm install -D rimraf&lt;/code&gt; to install the rimraf package to your devDependencies, and change the script to &lt;code&gt;"nuke:cache": "rimraf ./node_modules/.cache"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now you can run &lt;code&gt;npm run nuke:cache&lt;/code&gt; whenever the issue comes up again.&lt;/p&gt;

&lt;p&gt;Let me know in the comments if you've ever run into this problem. And let others know about the fix, because nobody should ever have to lose time or work to a misunderstood caching issue!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Useful YouTube Channels For Engineers</title>
      <dc:creator>Pablo Nevares</dc:creator>
      <pubDate>Tue, 31 Jul 2018 02:14:30 +0000</pubDate>
      <link>https://forem.com/pnevares/useful-youtube-channels-for-engineers-2b20</link>
      <guid>https://forem.com/pnevares/useful-youtube-channels-for-engineers-2b20</guid>
      <description>&lt;p&gt;YouTube has become an awesome place to learn for engineers of all levels, but the large number of videos on every topic can both a strength and a weakness. Their free, ad-supported platform means that the only barriers to making the most of YouTube are discovering great channels and having free time, so I've made a list of the best channels I've found. I've also added an example video that I've enjoyed from each channel so you can find the channels you might enjoy as well.&lt;/p&gt;

&lt;p&gt;Please add a comment with any great channels you know about!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCtxCXg-UvSnTKPOzLH4wJaQ"&gt;Coding Tech&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/dIiwFzFvsmw"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/Computerphile"&gt;Computerphile&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/XiFkyR35v2Y"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/ABBDevDay"&gt;Dev Day&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/1v091LSnThE"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ"&gt;freeCodeCamp&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/t6CBKf8K_Ac"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/FacebookDevelopers"&gt;Facebook Developers&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ZCuYPiUIONs"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCnUYZLuoy1rq1aVMwx4aTzw"&gt;Google Chrome Developers&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/X0KStP54kH4"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/GotoConferences"&gt;GOTO Conferences&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/AbgsfeGvg3E"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/jsconfeu"&gt;JSConf&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jUTE7lmrS70"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UC7TizprGknbDalbHplROtag"&gt;Layout Land&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-hmOZU7Zk10"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g"&gt;Microsoft Developer&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/vaNObub3zlc"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCijjo5gfAscWgNCKFHWm1EA"&gt;Mozilla Hacks&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5FdHqVDlXu0"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCGGRRqAjPm6sL3-WGBDnKJA"&gt;Netflix UI Engineering&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/f_wbCaSApFg"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/TechGuyWeb"&gt;Traversy Media&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/7r4xVDI2vho"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UCSD0dLRGQk_T-D3RvpM5aFQ"&gt;WeAreDevelopers&lt;/a&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/arNtoWxBuXc"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>youtube</category>
      <category>learning</category>
      <category>conferences</category>
      <category>tutorials</category>
    </item>
  </channel>
</rss>
