4
1

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.

IE11でオブジェクトは 'from' プロパティまたはメソッドをサポートしていません。と言われたときは

Last updated at Posted at 2018-07-13

環境

  • Windows10
  • IE11
  • Babel-preset-es2015

状況

IE11で以下のようなエラーが出ました

オブジェクトは 'from' プロパティまたはメソッドをサポートしていません。

本当に何を言っているのかわかりません。エラーが出たとされる行も全く関係のない場所が指されていました

原因

僕の場合、このエラーの原因はスプレッド演算子でした

[...files].map((file, index) => {

FileListをスプレッド演算子で配列にパースしようとした際のエラーでした

なので、これをfor文に書き換えれば、エラーは解消されました

めでたしめでたし

おわりに

BabelがPolyfillした際に置き換わったコードで発生したエラーかと思われますが、IEのエラー表示が不親切すぎてデバッグが大変でした

似たようなエラーが出た方は、新しい構文のPolyfillがうまく言っていない可能性があるのでチェックしてみるといいかもしれません

4
1
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
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?