Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLSearchParams polyfill not provided #10452

Open
lukepass opened this issue Sep 17, 2019 · 2 comments

Comments

@lukepass
Copy link

commented Sep 17, 2019

Bug Report

Current Behavior
Hello, I am very new to this tool so please forgive me :)

I looked into this issue "Babel is not providing polyfill for URLSearchParams #9667" and it says that it should have been fixed while ago.

I noticed that it still doesn't polyfill URLSearchParams:

Input Code

  var params = new URLSearchParams(window.location.search);
  var kind = params.get('kind');

Expected behavior/code
I expected it to be polyfilled.

Babel Configuration (.babelrc, package.json, cli command)

babel.config.js

const presets = [
  [
    '@babel/preset-env',
    {
      'useBuiltIns': 'entry',
      'corejs': 3,
    },
  ],
];

module.exports = {presets};

packages.json

{
  "dependencies": {
    "@babel/polyfill": "^7.6.0",
    "autoprefixer": "^9.6.1",
    "core-js": "^3.2.1",
    "postcss-cli": "^6.1.3",
    "uglify-js": "^3.6.0",
    "uglifycss": "0.0.29"
  },
  "devDependencies": {
    "@babel/cli": "^7.6.0",
    "@babel/core": "^7.6.0",
    "@babel/preset-env": "^7.6.0",
    "eslint": "^6.4.0",
    "eslint-config-google": "^0.14.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  }
}

.browserslistrc

last 1 version
> 0.2%
maintained node versions
not dead
ie 10

Environment

  • Babel version(s): 7.6.0 (@babel/core 7.6.0)
  • Node/npm version: 6.9.0
  • OS: Ubuntu 18.04
  • How you are using Babel: cli

Thanks.

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Sep 17, 2019

Hey @lukepass! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@JennieJi

This comment has been minimized.

Copy link

commented Oct 5, 2019

Hi @lukepass ,

As @babel/polyfill doced here, it is deprecated since v7.4.0, and the last verison is still using corejs@2.x.

Your problem should be fixed by using corejs v3 directly instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.