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.

Enable es6 polyfills

See original GitHub issue

I have such webpack config for babel-loader:

// ...
module: {
    loaders: [{
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loaders: ['react-hot', 'babel?stage=0&optional=runtime&externalHelpers']
    }
}

However running such code let copy = someArray.copyWithin(0); returns Uncaught TypeError: someArray.copyWithin is not a function, any ideas (it works in repl)?

Some other methods like Object.assign work fine…

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

29reactions
bengsfortcommented, Aug 27, 2016

Just a heads up to those finding this from Google that haven’t looked at the site lately (like me), the polyfill is no longer available in babel-core/polyfill unless I just really screwed up big time somewhere somehow, but it’s now a separate module altogether.

npm install --save-dev babel-polyfill

Then you can set it as an entry in your webpack config:

...
entry: [
  'babel-polyfill',
  './app/index'
],
...

or import it:

import 'babel-polyfill';

Docs: https://babeljs.io/docs/usage/polyfill/

0reactions
joshwienscommented, Aug 7, 2016

Resolving this as a resolution to the initial question exists in the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

es6-polyfill
A javascript polyfill library for es6 API such as findIndex, Array.from, etc.. Latest version: 1.1.0, last published: 4 years ago.
Read more >
Polyfills and transpilers
Just don't forget to use a transpiler (if using modern syntax or operators) and polyfills (to add functions that may be missing). They'll...
Read more >
babel/polyfill
Available from the dist/polyfill.js file within a @babel/polyfill npm release. This needs to be included before all your compiled Babel code. You can...
Read more >
Polyfills to support IE 11 and non ES6 browsers
If you are writing your JavaScript using ES6 or ES5, ... Below is a list of polyfills that we use that Babel does...
Read more >
Angular polyfills for es6 - typescript
Perhaps you don't understand what polyfills are used for. They allow you to use modern functionality in older browsers by adding support for ......
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