Another one-line npm package breaks the JavaScript ecosystem

An update to a tiny JavaScript library has thrown a large part of the JavaScript ecosystem into chaos on Saturday, with millions of projects believed to have been impacted.

Making the entire situation ridiculously absurd is that the whole mess was caused by a “one-liner” JavaScript library, marking this the second time when a tiny JavaScript project has caused widespread issues.

The is-promise one-liner

The package at the heart of this weekend’s problems is named is-promise. The library consists of two lines of raw source code, and developers can use it in their projects via a one-liner call.

Its purpose is to let developers test if a JavaScript object is a “Promise,” with the function returning a boolean result of yes or no when used in production.

Despite being just two lines of code that perform a basic check, the is-promise library is one of today’s most popular JavaScript npm packages (libraries). According to GitHub, the library is part of more than 3.4 million projects and used as a dependency by 766 other JavaScript libraries.

Over the weekend, the is-promised library was updated to receive support to work as an ES module — the standardized module system used by the JavaScript language.

However, the is-promise v.2.2.0 release didn’t adhere to the proper ES module standards. As soon as the update was out, projects that used is-promise inside their build chain started failing due to the improper ES module support [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].

The effect of the error was felt immediately, and impacted from closed-source JavaScript codebases to some of the JavaScript ecosystem’s biggest projects.

This included Facebook’s Create React App (the standard template for creating React apps), Google’s Angular.js framework, Google’s Firebasse-tools, Amazon’s AWS Serverless CLI, Nuxt.js, AVA, and more.

So this just happened.
Is-Promise just made a little change and it broke multiple packages.

So far as I’ve read its broken Firebase-tools, angular cli, aws serveless cli, create react app, possibly more.https://t.co/3ZZofevWNR— Preetâ„¢ (@TmPreet) April 25, 2020

The bug didn’t crash existing projects, so there was no actual downtime, but it did prevent developers from compiling new versions of their projects.

The is-promise team released an update but did not manage to fix the issue, and eventually rolled back the ES module support in v2.2.2, released a few hours after the dominos started falling around it.

Happened before in 2016

This incident marks the second time that a tiny JavaScript library caused problems all over the JavaScript ecosystem. Something similar happened in March 2016, when the author of the left-pad JavaScript library (another project amounting to 17 lines of code) decided to unpublish the library out of the blue, breaking thousands of projects in a similar way.

As it did in 2016, the is-promise incident raised questions and started discussions on the need to have one-liner libraries available in the ecosystem.

The same arguments are being raised again, as have been raised in 2016, and in years before, in the ecosystems of other programming languages.

There’s the side who says that modularization is going too far when developers are creating libraries that only account for a few lines of code, for the most trivial of operations.

Then there’s the side which argues that modularization of such items is needed, as in this manner, “Task A” could be managed inside one module, rather than have thousands of developers deal with it in their own projects in different ways.

Discussions about modularization have been raging for years and they’re most likely not going to reach a conclusion anytime soon.

Hot this week

The Hidden Costs of Overengineering Security

Complex security systems often create more vulnerabilities than they prevent by overwhelming teams with noise and maintenance demands while missing actual threats.

The True Cost of Chasing Compliance Over Security

Compliance frameworks create a false sense of security while modern threats evolve beyond regulatory requirements. Learn how to build actual protection rather than just checking boxes.

The Hidden Risk of Over Reliance on AI Security Tools

Over reliance on AI security tools creates dangerous blind spots by weakening human analytical skills. True resilience comes from balancing technology with continuous team training and critical thinking.

The Quiet Dangers of Overlooking Basic Security Hygiene

Basic security hygiene prevents more breaches than advanced tools, yet most teams overlook fundamentals while chasing sophisticated threats.

Your Password Strategy Is Wrong and Making You Less Secure

The decades-old advice on password complexity is forcing users into insecure behaviors. Modern security requires a shift to passphrases, eliminating mandatory rotation, and embracing passwordless authentication.

Topics

The Hidden Costs of Overengineering Security

Complex security systems often create more vulnerabilities than they prevent by overwhelming teams with noise and maintenance demands while missing actual threats.

The True Cost of Chasing Compliance Over Security

Compliance frameworks create a false sense of security while modern threats evolve beyond regulatory requirements. Learn how to build actual protection rather than just checking boxes.

The Hidden Risk of Over Reliance on AI Security Tools

Over reliance on AI security tools creates dangerous blind spots by weakening human analytical skills. True resilience comes from balancing technology with continuous team training and critical thinking.

The Quiet Dangers of Overlooking Basic Security Hygiene

Basic security hygiene prevents more breaches than advanced tools, yet most teams overlook fundamentals while chasing sophisticated threats.

Your Password Strategy Is Wrong and Making You Less Secure

The decades-old advice on password complexity is forcing users into insecure behaviors. Modern security requires a shift to passphrases, eliminating mandatory rotation, and embracing passwordless authentication.

Why API Security Is Your Biggest Unseen Threat Right Now

APIs handle most web traffic but receive minimal security attention, creating massive unseen risks that traditional web security tools completely miss.

Security Teams Are Asking the Wrong Questions About AI

Banning AI tools is a failing strategy that creates shadow IT. Security teams must pivot to enabling safe usage through approved tools, clear guidelines, and employee training.

The Illusion of Secure by Default in Modern Cloud Services

Moving to the cloud does not automatically make you secure. Default configurations often create significant risks that organizations must actively address through proper tools and processes.
spot_img

Related Articles

Popular Categories