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.

Disable caniuse-lite outdated warning for Node project

See original GitHub issue

Hello - I am using babel to compile TypeScript code and I’m not even targeting browsers, but I’m still getting a warning that caniuse-lite is outdated.

Is there some way that I can disable this warning?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Jimblycommented, Jun 9, 2022

I was also running into this both when targeting Node or when targeting specific old client targets (e.g. IE 10). Glancing at the code, I worked around this by adding process.env.BROWSERSLIST_IGNORE_OLD_DATA = 1; before calling into Babel and it suppresses the error. Hope this helps anyone else arriving here.

2reactions
Domiiicommented, Dec 2, 2021

I can confirm that the warning pops up if targets is not set and even if @babel/preset-env are not added!

Setting your babel config’s targets to node fixes the issue, e.g.:

babelCfg = {
  targets: {
    node: 16
  },
  // other babel options here
}

Note that the node target requires a concete semver.

The Problem

This finding implies that Babel now (somehow?) “targets” the browser by default, and (to the best of my knowledge) has not properly documented this behavior. I am not even sure what kind of targeting it does? Maybe it is caused by some plugins?

At the very least, this is a documentation bug: targets are only documented for @babel/preset-env, but are also applied if preset-env is not added. That needs to be fixed, and target behavior without preset-env should be properly explained.

Read more comments on GitHub >

github_iconTop Results From Across the Web

caniuse-lite is outdated. Please run next command `npm ...
Close Visual Studio · Head to C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X (X is the version of WebCompiler) · Delete following folders ...
Read more >
ERROR: Browserslist: caniuse-lite is outdated - SonarQube
Hi! Running scan with sonar 8.9 on a project containing css files shows the f…
Read more >
Fix static-analysis failure due to caniuse-lite dependency
The problem may be occurring because browserslist is detecting that caniuse-list is approximately 6 months old and outputs a warning using console.warn ......
Read more >
Warning from npm - caniuse-lite is outdated - Elixir Forum
I tried running the command, and got no errors, but the warning didn't go away. I also tried mix clean; mix compile ,...
Read more >
Browserslist: caniuse-lite is outdated - help - Meteor forums
I get message Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` But I don't have this ...
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