Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

babel-preset-env gives warning about decimal version numbers #258

Closed
frxstrem opened this issue Aug 13, 2017 · 2 comments
Closed

babel-preset-env gives warning about decimal version numbers #258

frxstrem opened this issue Aug 13, 2017 · 2 comments

Comments

@frxstrem
Copy link

When running Electron using electron-prebuilt-compile, I get the following warning:

Warning, the following targets are using a decimal version:

  electron: 1.7

We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.

This warning seems to be caused by babel-preset-env in line 408 of config-parser.js:

export function getDefaultConfiguration(rootDir) {
  return {
    'application/javascript': {
      "presets": [
        ["env", {
          "targets": {
            "electron": getElectronVersion(rootDir) // <--- line 408
          }
        }],
        "react"
      ],
      "sourceMaps": "inline"
    }
  };
}

getElectronVersion seems to return a decimal version when babel-preset-env wants a string version.

The problematic code seems to have been introduced in #214.

This issue has also already been posted in another repository: electron-userland/electron-prebuilt-compile#45

@ddavidebor
Copy link

annoying

@malept
Copy link
Member

malept commented Sep 2, 2017

Feel free to file a pull request to fix it and it will get reviewed.

malept added a commit that referenced this issue Sep 17, 2017
babel-preset-env will no longer take a Float as a version, and
electron-to-chromium can take a full Electron version.

Fixes #258.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants