Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

Breaks on firefox #105

Open 3210jr opened 7 years ago

3210jr commented 7 years ago

Hey,

Great package! everything works just fine on safari and chrome but refuses to upload files on firefox. Here is the error:

File.lastModifiedDate is deprecated. Use File.lastModified instead. app.js:14048:16 SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data[Learn More] lepozepo_cloudinary.js:224:20 Cloudinary._upload_file/</< http://localhost:3000/packages/lepozepo_cloudinary.js:224:20

How can I fix this?

NicholasEli commented 7 years ago

Can confirm, Mozilla is deprecating the portion of the Files api. https://www.fxsitecompat.com/en-CA/docs/2016/file-lastmodifieddate-has-been-deprecated/

Lepozepo commented 7 years ago

Awesome, I'll have a look as soon as I can. PRs are always welcome though :D

NicholasEli commented 7 years ago

I was considering that but could not find the call for the method in the code base.

Maybe it's in one of the supporting libraries used to run the package?

3210jr commented 7 years ago

@NicholasEli I found out what was causing the issues! (I hope....)

After hours and hours of searching for that line, and finding nothing, ... Turns out that the error has nothing to do with this package! You will not believe this but what is throwing the error is this line console.log("file: ", file);

I think firefox did not like what I was logging to the console... which is the file i got from event.target.files[0] .

Maybe go back into your code and check if you are facing the same issue.