2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

laravel-mix-polyfill でcore-js.....エラーが出たときの対処法

Posted at

laravel-mix-polyfillをインストール

laravel-mixでIE11に対応させたいと思いまして、
extensionにlaravel-mix-polyfilltというものがあり、これを追加するだけで使えるということで
早速追加しました。

npm install laravel-mix-polyfill --save-dev

しかし、使えんぞ・・・・・・・

インストールが終わって、早速、npm run watchしました。

しかし・・・・・・

ERROR in ./resources/js/components/test.vue?vue&type=script&lang=js&    
 (./node_modules/babel-loader/lib??
ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/test.vue?vue&type=
script&lang=js&)   
Module not found: Error: Can't resolve 'core-js/modules/web.dom.iterable' in '/Users/.....'

エラー発生!

とりあえず、エラーを読もう

エラーを読む限り、core-jsがないらしい。
そんなはずは、ないが、そういっているのでcore-jsを入れます。

yarn add core-js

最新は、3.2.1なので3.2.1を入れてました。(yarn 使ってますが、npmでも一緒です。)

しかし...

エラーは、変わらず・・・・

tumblr_o42b19PCrd1ukxrvfo1_500.gif

ネットサーフィンの結果

海外のサイトで

I returned core-js to the @2.6.5 version without misreporting.

ということだそうです。つまり、2.6.5にしたら、使えると・・・・

yarn add core-js@2.6.5

上記で使えるようになりました。

Compiled successfully in 7329ms

めでたし、めでたし。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?