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.

Unable to transpile ES6 > ES5

See original GitHub issue
Cannot find module 'core-js/library/fn/get-iterator'

This error is being thrown with the following stack when using presets: [“es2015”]. When not passing any options, the output file is not transpiled, it is an exact mirror of the original.

npm 2.14.7 node v4.2.1 gulp 4.0.0-alpha.1 gulp-babel 6.1.0

            return gulp.src([
                "./**/*.es6.js",
            ])
                .pipe(babel({
                    "presets": ["es2015"]
                }))
                .pipe(gulp.dest("./dist"))

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
allyrippleycommented, Feb 20, 2016

I was able to solve this by running npm i core-js --save, not sure if you can get away with just using it as a dev dependency. hope this saves someone some time

5reactions
trevorocommented, Nov 16, 2015

Aha. So the issue is that we’re not reading through the changes well enough

You have to ensure you install the babel-preset-es2015 package using

npm install --save-dev babel-preset-es2015 then update your .babelrc file to include

{
  "presets": ["es2015"]
}

then it started working again for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to transpile ES6 to ES5 for IE11 - vercel/next.js - GitHub
Bug report Describe the bug As per my knowledge next/babel in presets should transpile the code for non ES6 supporting browsers.
Read more >
Unable to transpile es6 to es5 using Babel - Stack Overflow
1. I have "build": "babel --out-dir dist src" in my package.json scripts , and I execute "npm run build". – refactor. Mar 16,...
Read more >
Transpiling EcmaScript6 code to ES5 using Babel
Turning your ES6 code to ES5 JavaScript. First, you need to install Babel: npm install babel --save-dev.
Read more >
How to Convert ES6 into ES5 using Babel | by Sunny Beatteay
1. Install Babel as Dev Dependency. First things first is to download the Babel command line interface, which will allow us to use...
Read more >
Read Setting up ES6 | Leanpub
2.6 Are there ES6 features that can't be transpiled to ES5? Some ECMAScript 6 features cannot be transpiled (compiled) to ES5. ES6 has...
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