kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.36k stars 2.39k forks source link

filetype.js does not match code in filetype.min.js - and filetype.min.js causes Safari error #1862

Closed cshehadi closed 2 months ago

cshehadi commented 6 months ago

Prerequisites

Steps to reproduce the issue

It's not really necessary to reproduce the problem.

Just compare the code of the _createForOfIteratorHelper function in the plugin files:

The code is different. The code in filetype.min.js is causing problems for Safari users uploading PDF files. The code in filetype.js fixes those issues. I'm assuming the filetype.js contains bug fixes and filetype.min.js was never updated to match.


We were getting errors from users uploading PDF files (only PDFs) in Safari. It was working in development but not on production.

When I compared the code of filetype.min.js (used on prod) to filetype.js (used on dev) I found they were different (see function _createForOfIteratorHelper)

On production I copied filetype.js to filetype.min.js and the problem went away, and Safari users were able to upload PDF files again.

Expected behavior and actual behavior

filetype.min.js should be a minified version of filetype.js - the code should match

When I follow those steps, I see...

unminify filetype.min.js and compare!

Environment

Browsers

Operating System

Libraries

Isolating the problem