toniov / p-iteration

Utilities that make array iteration easy when using async/await or Promises
https://toniov.github.io/p-iteration
352 stars 19 forks source link

Does not compile in error es2016 preset? #12

Closed nakawankuma closed 6 years ago

nakawankuma commented 6 years ago

[16:35:09] Error: Couldn't find preset "es2016" relative to directory "C:\src\w-azure\WebSite\w\node_modules\p-iteration" while parsing file: C:\src\w-azure\WebSite\w\node_modules\p-iteration\index.js

I buling project uses React, Browserify, Babel(es2015), Gulp and others... I've import P-iteration so have compile error . I can send project information. If you have the necessary information, please say me.

toniov commented 6 years ago

Hi!

Have you installed babel-preset-es2016 npm module? Also, I think you need babel-preset-es2017 as well.

nakawankuma commented 6 years ago

I installed es2015. I tell es2016 install.

package.json "babel-preset-es2015": "^6.24.1", "babel-preset-es2016": "^6.24.1", but I see compile error . Couldn't find preset "es2017" relative to directory

I more install es2017.

package.json "babel-preset-es2015": "^6.24.1", "babel-preset-es2016": "^6.24.1", "babel-preset-es2017": "^6.24.1", Gulp.js

return browserify(
        {
        entries:  'jsxsrc/app.jsx', debug: true,
        })
    .transform(babelify, { presets: ["react", 'es2017'] })

I take green, but take a runtime exception. "regeneratorRuntime is not defined"

I copy static find method and revert setting....

toniov commented 6 years ago

I don't think there is a problem with p-iteration.

According to this Q/A it seems you need to install babel-polyfill as well.

nakawankuma commented 6 years ago

ok. thank you toniov. I think install babel-polyfill. thank you.

toniov commented 6 years ago

You're welcome :)

Feel free to open another issue if you have any problem.

nakawankuma commented 6 years ago

I installed polifill and more. pcakage.json "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.7.0", "babel-preset-es2015": "^6.24.1", "babel-preset-es2016": "^6.24.1", "babel-preset-es2017": "^6.24.1", "babel-preset-react": "^6.24.1", but I tell message "regeneratorRuntime is not defined". I Change "static-methods.js" import 'babel-polyfill'; will done.

Do you think about it? I use polyfill in first time. I dont know change is correct.

toniov commented 6 years ago

According to the the Q/A I linked before, it seems you also need babel-core to make it work.

nakawankuma commented 6 years ago

Oh I mistake. before app.js import from xxxx import 'babel-polyfill';

after app.js import 'babel-polyfill'; import from xxxx

Its done.

nakawankuma commented 6 years ago

According to the the Q/A I linked before, it seems you also need babel-core to make it work.

sorry. It extracted code is some .