The Art of Storytelling for your Personal Brand

Here are my four simple tips to help you get started

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




HotModuleReplacementPlugin Has a Case Sensitivity Issue

I have an admitted refactor issue. The worst is when I decide something needs to be renamed. This got me bad while working on my personal web site. I decided to rename a folder.

We’ll call the original folder, “alongwindedfolder”. It sat in a directory hierarchy like so:

Then I renamed it to something like, “realshort”.

Then I renamed the imports and everything was working fine. The page loaded and did its thing. Not too bad!

But then I noticed my page wasn’t reloading when I changed my source code. Eh? I went down a rabbit hole on this one. Several actually. Learned about inotify watchers, the OS X FSEvents bug, several other methods to run Hot Loaders in webpack… Nothing worked.

What really got me was that everything in “theotherfolder” was working fine.

One thing I’ve learned so far as a developer is that I’m not that special. I’m not doing such crazy things that I am for some reason causing a bug that no one else was really having. Something was up. Something I did caused this.

Spoiler alert. It was definitely my fault. Here’s why.

See it? I camel cased the folder name. Oops. Webpack loaders seem unfazed by this. The site functioned just fine. No warnings about case sensitive file loadings or anything. But HotModuleReplacementPlugin had some issues with it and just stopped watching the folder and everything above it. Making the folder name all lowercase fixed my issue.

I did some cursory looking around and it turns out it’s not really HotModuleReplacementPlugin’s fault. MacOs is a case insensitive file system. Meaning you can name a folder helloWorld and try to create another called helloworld but MacOs will say “The name “helloworld” is already taken.” Linux on the other hand is case sensitive. HelloWorld and helloworld can exist in harmony with each other. This becomes a real problem when you develop on a MacOs and deploy on a Linux machine.

Well. Now we know…

Add a comment

Related posts:

Fitur Soraix

Soraix akan memberikan klien kami peluang luar biasa untuk mengambil bagian dalam pendapatan kami. Pemegang Soraix Token akan dapat menukar SRX Token mereka dengan menggunakan patokan 1: 1 terhadap…