rails/tailwindcss-rails

caniuse-lite is outdated and cannot update without package.json

dewaldreynecke opened this issue · 1 comments

After creating a new Rails 7.1.1 app with:
--css tailwind, and
-a propshaft
but no Javascript bundler/builder (rather using the now default importmaps) this message appears when running the server (using bin/dev) in development:

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

Running the prescribed command in the root of the app fails because package.json is not present in the app (nor should it be).

Here is the error:

/Users/dewald/.npm/_npx/072487b38308305a/node_modules/update-browserslist-db/index.js:31
    throw new BrowserslistUpdateError(
    ^
Error [BrowserslistUpdateError]: Cannot find package.json. Is this the right directory to run `npx update-browserslist-db` in?
    at detectLockfile (/Users/dewald/.npm/_npx/072487b38308305a/node_modules/update-browserslist-db/index.js:31:11)
    at updateDB (/Users/dewald/.npm/_npx/072487b38308305a/node_modules/update-browserslist-db/index.js:271:14)
    at Object.<anonymous> (/Users/dewald/.npm/_npx/072487b38308305a/node_modules/browserslist/cli.js:47:3)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  browserslist: true
}

@dewaldreynecke This message is coming from the upstream tailwindcss executable and there's nothing this gem can easily do to prevent the message from being emitted. However, there's nothing that's functionally broken (as far as I can tell) so feel free to ignore the message until upstream cuts a new release.

You may want to consider filing a bug report upstream if this is something that's blocking you.