Another one-line npm package breaks the JavaScript ecosystem

javascript.png

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.

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.

Open Source

About the author

E-Crypto News was developed to assist all cryptocurrency investors in developing profitable cryptocurrency portfolios through the provision of timely and much-needed information. Investments in cryptocurrency require a level of detail, sensitivity, and accuracy that isn’t required in any other market and as such, we’ve developed our databases to help fill in information gaps.

Related Posts

E-Crypto News Executive Interviews



bitcoin
Bitcoin (BTC) $ 66,619.00
ethereum
Ethereum (ETH) $ 4,043.43
binance-coin
Binance Coin (BNB) $ 496.87
cardano
Cardano (ADA) $ 2.19
tether
Tether (USDT) $ 1.00
xrp
XRP (XRP) $ 1.14
solana
Solana (SOL) $ 167.63
polkadot
Polkadot (DOT) $ 42.95
dogecoin
Dogecoin (DOGE) $ 0.252017
usd-coin
USD Coin (USDC) $ 1.00
USD
EUR
GBP
bitcoinBitcoin (BTC)
$ 66,619.00
ethereumEthereum (ETH)
$ 4,043.43
tetherTether (USDT)
$ 1.00
bitcoin-cashBitcoin Cash (BCH)
$ 636.32
litecoinLitecoin (LTC)
$ 198.51
bitcoinBitcoin (BTC)
57.457,22
ethereumEthereum (ETH)
3.487,36
tetherTether (USDT)
0,862475
bitcoin-cashBitcoin Cash (BCH)
548,81
litecoinLitecoin (LTC)
171,21
bitcoinBitcoin (BTC)
48,460.99
ethereumEthereum (ETH)
2,941.33
tetherTether (USDT)
0.727435
bitcoin-cashBitcoin Cash (BCH)
462.88
litecoinLitecoin (LTC)
144.40

Automated trading with HaasBot Crypto Trading Bots

Crypto Scams

Behind The Scenes: How this Crypto Community Responded to + $50m Hack
October 18, 2021
Crypto Scams
Crypto Scams Still Persistent In 2021, SEC Warns About Red Flags To Watch
September 9, 2021
Poly Network
Here’s How Hackers Stole Over $600 million in the Poly Network Attack
August 12, 2021
The World’s Most Infamous Crypto Hacks and Scams
July 31, 2021
Cryptocurrency Exchanges
Cryptocurrency Exchanges and the Plague of Scams and Bans
June 29, 2021

Blockchain/Cryptocurrency Questions and Answers

ICo Presale
The Science Behind ICO Presales…
October 14, 2021
Beginner’s Guide to Investing in Cryptocurrency
August 9, 2021
Short-Sell Cryptocurrency
How to Short-Sell Cryptocurrency: A Brief Overview
July 17, 2021
Klaytn
What Is Klaytn (KLAY) And How Does It Work?
July 16, 2021
Cryptocurrencies
Our Crypto Roundup Interview Asks- Do Cryptocurrencies Have a Future?
July 15, 2021


CryptoCurrencyUSDChange 1hChange 24hChange 7d
Bitcoin67,068 0.03 % 7.15 % 19.05 %
Ethereum4,076.5 0.04 % 7.28 % 16.53 %
Binance Coin501.34 0.02 % 3.00 % 13.85 %
Cardano2.200 0.52 % 3.97 % 3.93 %
Tether0.9986 0.03 % 0.08 % 0.23 %
XRP1.140 0.20 % 5.81 % 3.89 %
Solana170.17 3.11 % 8.96 % 11.95 %
Polkadot30.87 2.19 % 17.29 % 10.73 %
Dogecoin0.2538 0.71 % 3.78 % 12.11 %
USD Coin1.000 0.14 % 0.20 % 0.17 %

bitcoin
Bitcoin (BTC) $ 66,619.00
ethereum
Ethereum (ETH) $ 4,043.43
binance-coin
Binance Coin (BNB) $ 496.87
cardano
Cardano (ADA) $ 2.19
tether
Tether (USDT) $ 1.00
xrp
XRP (XRP) $ 1.14
solana
Solana (SOL) $ 167.63
polkadot
Polkadot (DOT) $ 42.95
dogecoin
Dogecoin (DOGE) $ 0.252017
usd-coin
USD Coin (USDC) $ 1.00