question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[fixed] 2.1.0 exports broken in 2.2.0

See original GitHub issue

Via comments on https://github.com/chalk/ansi-styles/commit/74502955deaf0eb977507757e33c52cad5a9aefa#commitcomment-16867578

import ansi from 'ansi-styles';

console.log(`${ansi.colors.red.open}hello world${ansi.colors.red.close}`)

No longer works, with the result of

undefined is not an object (evaluating _ansiStyles2.default.colors.red)


Steps to reproduce:

  1. Install 2.1.0 npm install ansi-styles@2.1.0
  2. Use the code above
  3. Update to 2.2.0 npm install ansi-styles@2.2.0
  4. Re-run the same code, experience error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

20reactions
Qix-commented, Mar 28, 2016

Version 2.2.0 has been unpublished. We’ll do a major bump sometime tomorrow.

Thanks for bringing this to our attention @ajwhite 👍

13reactions
Qix-commented, Apr 20, 2016

Post Mortem

2.2.0 was actually released on Feb 21. Some breaking changes that were finally merged (ref #13) were sitting in master until we wanted to do a major version bump. However these changes were inadvertently released in 2.2.0 when the next release should have been 3.0.0 (minor bump instead of a major bump).

Since chalk wasn’t affected by the otherwise breaking changes (this was by-design), but other projects that use ansi-styles might have been, the breaking release 2.2.0 went unnoticed until now.

This is also due to the fact the ‘breaking’ changes were not buggy code, but intentional changes meant for a major version bump, hence why tests still passed on Travis and thus why we were not notified of any breaking CI runs.

As Sindre mentioned, we went ahead and still did a 2.2.1 patch release despite the unpublishing of 2.2.0, for those users that had already bumped their package.json dependencies to ^2.2.0.

We acknowledge that the unpublishing of the broken version was unnecessary and a patch release would have been the preferable solution.

The root issue has been addressed internally (unrelated: externally, too) and won’t be happening again in the future.


Maintainers that are facing errors related to ansi-styles after fixing broken code from the 2.2.0 release (i.e. users that upgraded to 2.2.0 and modified their code to use the new API) can do one of two things:

  • wait for the 3.0.0 release (your code should work when this happens)
  • temporarily change your dependency to "dependencies": {"ansi-styles": "chalk/ansi-styles"}

All other users experiencing errors related to ansi-styles should clear out their node_modules/ directory and re-run npm install - the problem should resolve itself.

We also recommend updating your dependencies to specify ansi-styles@^2.2.1, though this shouldn’t be required.


If you use shrinkwrap, refer to #17.


For any other issues, you are definitely welcome to open a new ticket and I will personally see to it that it’s handled in a timely manner.

Sorry again to anyone affected by this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rokoko Studio 2.1.0
Fixed an issue where the auto-updater sometimes didn't download and install all the files, generating an error when trying to launch Studio ...
Read more >
Changes — Werkzeug Documentation (2.2.x)
Mark top-level names as exported so type checking understands imports in user projects. #2122. Fix some types that weren't available in Python 3.6.0....
Read more >
Release Notes - Exporter - Data Center - Confluence - DEISER
Release notes 2.11.6 02 Sep 2021. Summary: Bugs fixes. Bugs fixes: Empty CSV when having issue limit and more than 1K issues to...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug listing with status RESOLVED with resolution FIXED as at 2022/12/31 05:46:05.
Read more >
LaTeXiT RSS (it) - Page personnelle de Pierre Chatelier
Version 2.16.4 (04/08/2021). Fixed library importation broken by some security enforcements in MacOS;; better error reporting when history or library cannot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found