Skip to content

baseline-browser-mapping prevents reproducible builds. #105

Closed

Description

@alumni

Is your feature request related to a problem? Please describe.

If your installed version of baseline-browser-mapping is greater than 2 months old, you will receive a console warning advising you to update to the latest version.

This warning is blocking us to run CI pipelines on older builds.

This violates the principle of reproducible builds - we need to be able to reproduce any build from the past and have the exact same output each time.

Besides that, it's also really annoying to have to constantly update this package when all we care about is nodejs features which rarely change.

Describe the solution you'd like
Provide a way to opt out of (or better: opt into) this feature.

Describe alternatives you've considered
Difficult to find alternatives when Babel.js depends on this package.

Additional context
n/a

Activity

  1. WebMechanic commented on Nov 20, 2025

    @WebMechanic

    same. even if updated (like I did yesterday) this annoying message keeps reappearing

    [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: npm i baseline-browser-mapping@latest -D

  2. tonypconway commented on Nov 20, 2025

    @tonypconway
    Collaborator

    Hi @alumni thanks for raising this. I assume you're not using the Baseline targets in your Babel/browserslist config as , is that right? It would certainly make sense to update the module to only show the warning if users actually call it, where at the moment it's being called whenever browserslist spins up. 2 months is also probably overzealous for most users anyway, as the majority will be targeting widely available if anything, and that data is pretty settled in most cases.

    I'll think about our best approach for opt-in/opt-out. I don't want to remove warning altogether as they will become relevant down the line, but of course they shouldn't appear if you're not targeting Baseline anyway.

    blocking us to run CI pipelines on older builds

    It should go without saying that I won't necessarily be able to fix this issue for you.

    @WebMechanic

    same. even if updated (like I did yesterday) this annoying message keeps reappearing

    That's surprising. I've just checked and as of today any version of the module from 2.8.7 onwards shouldn't show a warning because the embedded timestamp is < 2 months ago. Can you check in your node_modules and share the package.json contents for baseline-browser-mapping?

  3. WebMechanic commented on Nov 21, 2025

    @WebMechanic

    @tonypconway initially it was "baseline-browser-mapping": "latest", it's now "baseline-browser-mapping": "^2.8".
    In node_modules there is a "version": "2.8.30"

    In both cases I get the warning, noteably when running PostCSS.

  4. tonypconway commented on Nov 21, 2025

    @tonypconway
    Collaborator

    That's very strange as 2.8.30 is only a day and a half old so it certainly shouldn't be triggering the message. Can you share a repo where you're seeing this error so I can try to reproduce?

  5. alumni commented on Nov 21, 2025

    @alumni
    Author

    In my case I have no control over babel because nyc (and other tools) import it.

    In one repo we are checking if stderr is empty (console.warn outputs to stderr) to make sure things are fine. We just replaced nyc with c8, so we got rid of babel thankfully.

    In the other repo, @nx/jest depends on babel, but I didn't see the message yet. Luckily, we don't use babel to build and we override the NX defaults so that we can have the tests as close as possible to the production build :)

    Anyway, since I managed to avoid this issue in the repos I'm working (for now), you can also close this if you'd like. Initially, it was a bit shocking to see something browser-related breaking the backend CI :P

  6. tonypconway commented on Nov 21, 2025

    @tonypconway
    Collaborator

    Thanks for letting me know @alumni , good to hear you've got a workaround for now. I'm still going to refactor so that the warning is only called if users are actually calling the module, as at the moment it performs the check whenever browserslist or any other module loads it, which is overkill.

    I'm going to keep it open until I make those changes, and also while we figure out what is going on with @WebMechanic 's build - it definitely shouldn't be triggering a warning on 2.8.30!

  7. WebMechanic commented on Nov 24, 2025

    @WebMechanic

    FYI: just updated to 2.8.31 and Vitest 4.0.13 using happy-dom 20.0.10 (as @vitest-environment happy-dom). The project uses yarn 3.6 as the package manager.

    [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: npm i baseline-browser-mapping@latest -D

  8. alumni commented on Nov 24, 2025

    @alumni
    Author

    I'm still going to refactor so that the warning is only called if users are actually calling the module, as at the moment it performs the check whenever browserslist or any other module loads it, which is overkill.

    Just an idea: this is the only module we had that is not a CLI but produces CLI output - IMO, this shouldn't happen at all 😛 Maybe baseline-browser-mapping should report the timestamp of its data and let the other tools handle outdated data.

    Quite some packages use debug to log things, that would require the user to set the env var DEBUG=baseline-browser-mapping.

  9. henhal commented on Nov 24, 2025

    @henhal

    👍 on this issue. I had to introduce babel-jest in my pure Node.JS backend code a while back to get around something (I don't remember what right now, something with commonjs vs ESM probably), and now when running the unit tests of my package a month later I keep getting a zillion of these warnings. There's not a trace of any frontend code in my application so browser warnings are not applicable to my setup.

    $ yarn why baseline-browser-mapping
    
    => Found "baseline-browser-mapping@2.8.6"
    info Reasons this module exists
       - "@babel#preset-env#@babel#helper-compilation-targets#browserslist" depends on it
       - Hoisted from "@babel#preset-env#@babel#helper-compilation-targets#browserslist#baseline-browser-mapping"
    

    While I second the opinion that libraries should not output warnings that are dependent on the current time, if you must do this, could you at least support suppressing it, e.g. by BASELINE_BROWSER_MAPPING_DISABLE_WARNINGS=1or something?

  10. techrome commented on Nov 28, 2025

    @techrome

    I suddenly started getting this warning even with upgrading the library through "npm i baseline-browser-mapping@latest -D"

  11. switz commented on Nov 28, 2025

    @switz

    the risk of having "mildly old" baseline data is way lower than the annoyance of seeing this message all the time 🤷

    it should be a year or two minimum

  12. TCNOco commented on Nov 28, 2025

    @TCNOco

    I am seeing a lot of the [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: 'npm i baseline-browser-mapping@latest -D' messages pop up in my CI, however it should be up-to-date. I'm not too sure what is happening.

    I run the command, same issue.

    Even running npm i --save-dev baseline-browser-mapping@latest I see the same when using npm run build for example.

    Adding/updating it using the above command doesn't do much other than adding it to my package.json as "baseline-browser-mapping": "^2.8.32",. Not too sure what package is using it, and npm why baseline-browser-mapping just shows me no dependencies found.

    This started popping up after I updated @types/react from 19.2.5 to 19.2.7, Next from 16.0.3 to 16.0.5, and sass from 1.94.0 to 1.94.2

    {
      "name": "map",
      "version": "0.1.0",
      "scripts": {
        "dev": "next dev",
        "build": "next build",
        "lint": "next lint"
      },
      "dependencies": {
        "next": "16.0.5",
        "react": "^19.2.0",
        "react-dom": "^19.2.0"
      },
      "devDependencies": {
        "@types/node": "^24.10.1",
        "@types/react": "^19.2.5",
        "@types/react-dom": "^19.2.3",
        "sass": "^1.80.0",
        "typescript": "^5.3.0"
      }
    }
  13. tonypconway commented on Nov 28, 2025

    @tonypconway
    Collaborator

    Looks like we have two separate issues here:

    Warning displayed too often

    • At the moment the function that checks for staleness is called every time the module is loaded which is obviously too often - it should only be called if someone actually tries to use the functionality.
    • The vast majority of people who actually want to use this module are only going to be looking for Widely available or a year 2-3 years in the past, in which case updating every ~2 years or so is probably sufficient.
    • Those who might want to target Newly available (you crazy cats!), or those using the getAllVersions() function do need up to date data, as they depend on the very latest browsers being in the data set. Warning those users by defauly is an important safeguard against unwittingly running out of compatible browsers.
    • There's not currently a way to suppress the warning.

    I'm working on a PR that addresses these points. Warnings will only be attempted if the functions are actually called, they'll only be displayed if your feature cut off date is in the last two months (i.e. Newly available or widelyAvailableOnDate: today + 2 years and 2 months) and your lastUpdated date is >2 months in the past, and it adds suppression mechanisms, including recognising the existing browserlist environment variable for suppressing data staleness messages.

    I'm planning to make this a minor release rather than a patch, as it exposes new config options and changes functionality. Hoping to get it out middle of next week, and will probably do a beta release so some folks can verify it. I still need to write tests, too.

    Some people are getting the warning when they've already updated

    I haven't been able to reproduce this issue yet. I'm hoping that the changes in #108 will resolve it, but if they don't, I'll keep digging.

  14. avxobro commented on Nov 28, 2025

    @avxobro

    How annoying.

  15. 41 remaining items

  16. added a commit that references this issue on Dec 3, 2025
    226fd01
  17. tonypconway commented on Dec 3, 2025

    @tonypconway
    Collaborator

    baseline-browser-mapping v2.9.0 is live - read the release notes for more information.

  18. ai commented on Dec 3, 2025

    @ai
    Contributor

    Thanks. update-browserslist-db 1.2 and browserslist 4.28.1 were also releases.

  19. connorshea commented on Dec 3, 2025

    @connorshea

    Glad to see this fixed, it was annoying to have it suddenly start popping up yesterday in our app. Thank you for the quick fix!

  20. drake-nathan commented on Dec 19, 2025

    @drake-nathan

    Hi, I'm getting this suddenly in a style guide package that I maintain. Next.js is installed in the monorepo, but all packages are updated (locally, maybe not in main). I get this error when I run lint, of all things. The env var changes nothing for me. Packages absolutely should not be printing console warnings when they could be some random nested dependency. I don't have time to figure out why this package is being pulled in for me, I'm just gonna write a script to delete this warning.

  21. tonypconway commented on Dec 19, 2025

    @tonypconway
    Collaborator

    Your dependency chain is probably nextjs -> browserslist -> baseline-browser-mapping.

    It became abundantly clear that the way the warning was implemented wasn't suitable when this was first reported over a month ago, and we also learned that the way nextjs was bundling the package made it impossible for people to update the package themselves as well.

    Release 2.9.0 addressed this, as described in the PR linked to this issue. browserslist 4.26.1 suppresses the warnings altogether. nextjs 16.1.0 treates baseline-browser-mapping as a separate dependency (see vercel/next.js#86653 ).

    I would suggest updating your nextjs version to latest then ensuring baseline-browser-mapping is up to date if you don't want to implement a workaround.

  22. drake-nathan commented on Dec 19, 2025

    @drake-nathan

    @tonypconway Thanks for the reply. I did update but maybe I need to clear node modules or something.

  23. abue-ammar commented on Jan 25, 2026

    @abue-ammar

    Imagethis shit appearing again latest nextjs

  24. eliotgevers commented on Jan 31, 2026

    @eliotgevers

    I have this issue again on version 16.1.6

  25. tonypconway commented on Feb 3, 2026

    @tonypconway
    Collaborator

    @abue-ammar The wording of the message you're seeing hasn't been in this module since v2.9.0 released ~2 months ago. So you're not using the latest version of this module, and need to look at how Next.js is loading browserslist in your local set up. In future, please refrain from just posting obscenities without properly investigating and/or offering any actually useful information.

    AIUI Next.js 16.1.0 compiled version 2.8.3 of this module into browserslist which had the old error message you're seeing. It looks like 16.2.0 plans to move up to browserslist 4.28.1 which suppresses warnings from this module and issues its own warnings.

    There's nothing else I can do in this module to stop Next.js triggering errors, and they've done what they can to address it.

  26. lbp003 commented on Feb 9, 2026

    @lbp003

    browserslist

    Worked. Thank you

  27. bhilbis commented on May 13, 2026

    @bhilbis

    nice thanks it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions