scottcharlesworth / laravel-mix-polyfill

A Laravel Mix extension to include polyfills by using Babel, core-js, and regenerator-runtime
MIT License
50 stars 7 forks source link

Module not found: Error: Can't resolve 'core-js/modules/es6.array.iterator' #6

Closed sunscreem closed 5 years ago

sunscreem commented 5 years ago

I did a clean npm install this morning and it seems like es6.array.iterator is no longer in the core-js package.

I'm a bit stuck on how to fix this.

I'm using this package purely to stop IE11 errors - maybe this is a bit overkill for that use case?

ghost commented 5 years ago

Having the same issue..

@sunscreem you can try this solution https://stackoverflow.com/a/52352875

sunscreem commented 5 years ago

Thanks @Rux77 - will give it a go.

scottcharlesworth commented 5 years ago

@sunscreem did the suggested solution work for you? When did this start?

I don't believe there's been any changes to core-js@2.* for a couple of months, and the file referenced does still exist.

scottcharlesworth commented 5 years ago

@sunscreem I've been trying a few options to reproduce this error, and I have managed to find a scenario that does so.

Have you added core-js@3.* as a dependency in your project?

If so you will need to set the corejs option:

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css')
   .polyfill({
      corejs: 3
   });
sunscreem commented 5 years ago

Perfect - that's it sorted :)