Failed to load module script: The server responded with a non-JavaScript MIME type of “text/html” in Nginx when deploying an Angular application

Failed to load module script: The server responded with a non-JavaScript MIME type of “text/html”. Strict MIME type checking is enforced for module scripts per HTML spec. This happens in Google Chrome and any modern browser that supports JavaScript modules. For example when “building” the Angular 8+ app, this file is usually generated, that is…

What is a namespace in JavaScript?

There was a time when we didn’t have the power of ES2015 JavaScript modules to create applications; so, we had to invent a system to keep our code well-organized, avoid collisions in names, share functions among JavaScript blocks or files, etc. that is when the concept of namespace came into play in the JavaScript world….

What is semantic versioning?

Have you seen how a project like Angular is versioned? You have maybe noticed when a brand-new release of that framework is created they release  it with three numbers, e. g. Angular 5.0.0, now the question is: what those three digits mean? The answer is simple: they are using a system called Semantic Versioning or mostly…

How to set moment.js timezone when creating a date

The Problem Since Moment.js is a library that runs client-side, when you create a new date using it; the constructor will take the current user’s timezone. This is not convenient when you want to display a list of dates that don’t depend on the user’s browser. Let’s see an example of this, imagine you have…

Inventing on Principle by Bret Victor

If you are a person who believes web development is not only solving problems in the best way but creating new ways of thinking while having compassion for others, then this talk is for you; 54 minutes about a different way to see why ideas are one of most important things humans can create.

Logging detailed error messages when running Gulp.js tasks

Gulp.js has become one of the most used task managers nowadays. But sometimes, when running several tasks with many pipes( ) on them, it is very difficult to understand what’s wrong or the actual reason why our task is not working as expected. For others like me, who like to have a better error description, here is what needed to do: Install Gulp Util npm…

Could not open input file: composer.phar error in Symfony 2. SOLVED.

This is a common issue that is related to bad installation of our favorite PHP package manager: Composer. Let’s fix it: Open your terminal and run following comand in order to get the latest version of Composer: curl -sS https://getcomposer.org/installer | php I recommend you to move the composer.phar file to a global “bin” directory,…