画像ファイルから位置情報などを取得するのに exif-js は使用してはいけない(exifr を使え)
技術情報
公開: 2025年01月27日
https://github.com/exif-js/exif-js/issues/120
@mmase This happens when you use strict mode. It's been there since JS v5 (2009, thanks to Douglas Crockford :)). In strict mode you can not tnot declare a new variable without an explicit var. Probably some other bit of JavaScript has a "use strict"; in it, and then you use exif.
Plenty of other people have complained about this. But there are some other for loops that also don't have var yet. But I'll check the pull request.
strict mode を使用している JavaScript が一つでもあると発生すると思われる。
そのため、React(の開発モードだけ?)では使えない。
Google 検索すると exif-js が上位にあがってくるが、exif-js は 2017 年で開発が停止しており、この不具合は解消されない。
代わりに exifr を使用する。