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.

Chrome target becomes chrome 4

See original GitHub issue

Bug Report

  • I would like to work on a fix!

Current Behavior My config is set to >=0.5% in GB, but now adding this parameter brings the target version for Chrome down to v4. I’ve tried adding >=0.5% in GB and not chrome but no combination seems to shift the Chrome version. When it gets to >=40% in GB it will correctly use the last 2 versions flag for chrome.

I’m not sure if this is a browserlist or caniuse issue, I tried the GB.js caniuselite file from a year ago to see if it was corrupted data but it made no change.

Output

@babel/preset-env: `DEBUG` option

Using targets:
{
  "android": "79",
  "chrome": "4",
  "edge": "79",
  "firefox": "72",
  "ie": "11",
  "ios": "10.3",
  "node": "12.16",
  "opera": "65",
  "safari": "12.1",
  "samsung": "9.2"
}

Using modules transform: false

Using plugins:
  proposal-nullish-coalescing-operator { "android":"79", "chrome":"4", "edge":"79", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }
  proposal-optional-chaining { "android":"79", "chrome":"4", "edge":"79", "firefox":"72", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }
  proposal-json-strings { "chrome":"4", "ie":"11", "ios":"10.3" }
  proposal-optional-catch-binding { "chrome":"4", "ie":"11", "ios":"10.3" }
  proposal-async-generator-functions { "chrome":"4", "ie":"11", "ios":"10.3" }
  proposal-object-rest-spread { "chrome":"4", "ie":"11", "ios":"10.3" }
  transform-dotall-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
  proposal-unicode-property-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
  transform-named-capturing-groups-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
  transform-async-to-generator { "chrome":"4", "ie":"11", "ios":"10.3" }
  transform-exponentiation-operator { "chrome":"4", "ie":"11" }
  transform-template-literals { "chrome":"4", "ie":"11", "ios":"10.3", "safari":"12.1" }
  transform-literals { "chrome":"4", "ie":"11" }
  transform-function-name { "chrome":"4", "ie":"11" }
  transform-arrow-functions { "chrome":"4", "ie":"11" }
  transform-block-scoped-functions { "chrome":"4" }
  transform-classes { "chrome":"4", "ie":"11" }
  transform-object-super { "chrome":"4", "ie":"11" }
  transform-shorthand-properties { "chrome":"4", "ie":"11" }
  transform-duplicate-keys { "chrome":"4", "ie":"11" }
  transform-computed-properties { "chrome":"4", "ie":"11" }
  transform-for-of { "chrome":"4", "ie":"11" }
  transform-sticky-regex { "chrome":"4", "ie":"11" }
  transform-unicode-regex { "chrome":"4", "ie":"11", "ios":"10.3" }
  transform-spread { "chrome":"4", "ie":"11" }
  transform-parameters { "chrome":"4", "ie":"11" }
  transform-destructuring { "chrome":"4", "ie":"11" }
  transform-block-scoping { "chrome":"4", "ie":"11", "ios":"10.3" }
  transform-typeof-symbol { "chrome":"4", "ie":"11" }
  transform-new-target { "chrome":"4", "ie":"11" }
  transform-regenerator { "chrome":"4", "ie":"11" }
  transform-member-expression-literals { "chrome":"4" }
  transform-property-literals { "chrome":"4" }
  transform-reserved-words { "chrome":"4" }
  syntax-dynamic-import { "android":"79", "chrome":"4", "edge":"79", "firefox":"72", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }

Expected behavior/code When I remove the >=0.5% in GB I get the expected output

@babel/preset-env: `DEBUG` option

Using targets:
{
  "android": "79",
  "chrome": "79",
  "edge": "79",
  "firefox": "72",
  "ie": "11",
  "ios": "13",
  "node": "10.19",
  "opera": "65",
  "safari": "12.1",
  "samsung": "9.2"
}

Using modules transform: false

Using plugins:
  proposal-nullish-coalescing-operator { "android":"79", "chrome":"79", "edge":"79", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }
  proposal-optional-chaining { "android":"79", "chrome":"79", "edge":"79", "firefox":"72", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }
  proposal-json-strings { "ie":"11" }
  proposal-optional-catch-binding { "ie":"11" }
  proposal-async-generator-functions { "ie":"11" }
  proposal-object-rest-spread { "ie":"11" }
  transform-dotall-regex { "firefox":"72", "ie":"11" }
  proposal-unicode-property-regex { "firefox":"72", "ie":"11" }
  transform-named-capturing-groups-regex { "firefox":"72", "ie":"11" }
  transform-async-to-generator { "ie":"11" }
  transform-exponentiation-operator { "ie":"11" }
  transform-template-literals { "ie":"11", "safari":"12.1" }
  transform-literals { "ie":"11" }
  transform-function-name { "ie":"11" }
  transform-arrow-functions { "ie":"11" }
  transform-classes { "ie":"11" }
  transform-object-super { "ie":"11" }
  transform-shorthand-properties { "ie":"11" }
  transform-duplicate-keys { "ie":"11" }
  transform-computed-properties { "ie":"11" }
  transform-for-of { "ie":"11" }
  transform-sticky-regex { "ie":"11" }
  transform-unicode-regex { "ie":"11" }
  transform-spread { "ie":"11" }
  transform-parameters { "ie":"11" }
  transform-destructuring { "ie":"11" }
  transform-block-scoping { "ie":"11" }
  transform-typeof-symbol { "ie":"11" }
  transform-new-target { "ie":"11" }
  transform-regenerator { "ie":"11" }
  syntax-dynamic-import { "android":"79", "chrome":"79", "edge":"79", "firefox":"72", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

  • Filename: .babelrc
{
  "sourceType": "unambiguous",
  "presets": [
    [
      "@babel/preset-env", {
        "debug": true,
        "modules": false,
        "useBuiltIns": "usage",
        "corejs": 3,
        "targets": "last 2 versions, >=0.5% in GB, node 10, not IE <= 10, not dead"
      }
    ],
    "@babel/preset-react"
  ],
  // Only use node polyfills for server files, no need for IE11 support on the server
  "overrides": [{
    "test": "./src/server",
    "presets": [
      [
        "@babel/preset-env", {
          "debug": true,
          "modules": false,
          "useBuiltIns": "usage",
          "corejs": 3,
          "targets": "node 12"
        }
      ],
      "@babel/preset-react"
    ]
  }],
  "plugins": [
    "@babel/plugin-proposal-optional-chaining",
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-transform-exponentiation-operator",
    "syntax-dynamic-import",
    "transform-async-to-generator",
    "universal-import"
  ]
}

Environment

  System:
    OS: macOS 10.15.3
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
  npmPackages:
    @babel/core: ^7.8.6 => 7.8.6 
    @babel/plugin-proposal-class-properties: ^7.8.3 => 7.8.3 
    @babel/plugin-proposal-optional-chaining: ^7.8.3 => 7.8.3 
    @babel/preset-env: ^7.8.6 => 7.8.6 
    @babel/preset-react: ^7.8.3 => 7.8.3 
    @babel/register: ^7.8.6 => 7.8.6 
    babel-cli: ^6.26.0 => 6.26.0 
    babel-eslint: ^10.1.0 => 10.1.0 
    babel-loader: ^8.0.6 => 8.0.6 
    babel-plugin-syntax-dynamic-import: ^6.18.0 => 6.18.0 
    babel-plugin-transform-async-to-generator: ^6.24.1 => 6.24.1 
    babel-plugin-universal-import: ^4.0.0 => 4.0.0 
    eslint: ^6.6.0 => 6.8.0 
    webpack: ^4.16.5 => 4.41.6 

Same issue in node 10.x

Possible Solution I have a feeling it’s a browserlist issue with parsing the semvar

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JLHwungcommented, Feb 28, 2020

@dalyr95 Thanks for the report. This issue duplicates https://github.com/browserslist/browserslist/issues/431, so it should be fixed on browserslist side. I will see if I can come up with a PR later.

where does the and_chr 4 come from, I think it’s getting confused with Android 4?

See https://github.com/browserslist/browserslist/issues/431#issuecomment-565230615

0reactions
max-mykhailenkocommented, Apr 12, 2020

@nicolo-ribaudo @dalyr95 @JLHwung I still have this problem when use expression like > 0.9% in my stats. Will create new issue in browsersList repo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Chrome updates (Windows) - Google Support
As a Microsoft Windows administrator, you can use Google Update to manage how your users' Chrome browser and Chrome apps are updated. You...
Read more >
Target domain - Chrome DevTools Protocol - GitHub Pages
Id assigned to the session. Target.closeTarget #. Closes the target. If the target is a page that gets closed too.
Read more >
From 0 to 70% Market Share: How Google Chrome Ate ... - Nira
Here's what will be explored in this article: Why developers, not casual Internet users, were Google's primary target for Chrome; How Google was...
Read more >
css - Can you target Google Chrome? - Stack Overflow
@media screen and (-webkit-min-device-pixel-ratio:0) { /*Chrome CSS here*/ #cartUpdate { position:absolute; width:160px; height:30px; ...
Read more >
Google Chrome Gets 'Default to Guest' Mode for Stateless ...
At the end of your "Target:" line add the following: chrome.exe --guest; Once complete, use the shortcut to launch Chrome. Windows users can ......
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