Browserslist: caniuse-lite is outdated

Why does rails test print the following message?

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

This message is not coming from Ruby or Rails at all. It’s printed into stderr by the js lib browserslist, which is a dependency of tailwindcss, which is vendored with the gem tailwindcss-rails.

There doesn’t seem to be a fix, except to wait for tailwind to ship with updated browserslist, and for tailwindcss-rails to update its tailwind.

Workaround

This issue suggests setting env variable BROWSERSLIST_IGNORE_OLD_DATA=1 to silence the warning.

If you have a better answer/solution for this, I upvoted this discussion on tailwind’s github. I’ll be watching it, so if you comment there, I’ll update this note.



Date
October 10, 2023