dylanarmstrong / puz

puz parser
ISC License
6 stars 2 forks source link

Demo upload fails with "Failed to execute 'readAsArrayBuffer' on 'FileReader'" #1

Closed jevakallio closed 3 years ago

jevakallio commented 3 years ago

Hi! Thanks for creating this library, I found it on npm while building out a Crossword-related project.

I haven't used the library in my own code yet, but I found an issue while testing it out on the official demo site.

Issue

When using the demo site, some .puz files cause an error Uncaught TypeError: Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob', while others work fine.

Example of failing puzzle: https://www.nytimes.com/crosswords/game/daily/2020/06/09

Example of a working puzzle: https://www.nytimes.com/crosswords/game/daily/2020/03/09

Both files open fine in Across Lite. Neither contains any weird elements (circles, gray squares, rebus answers, descriptions, etc.)

If you don't have access to downloading .puz files from NY Times, I can send you a failing file (don't want to upload publicly due to licensing concerns).

Browser details:

Steps to reproduce

Expected outcome: Puzzle is displayed.

Actual outcome: Nothing happens in the UI. Chrome developer tools show below error.

Stack trace:

Uncaught TypeError: Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'.
    at oe (index.jsx:87)
    at Object.Wt (react-dom.production.min.js:52)
    at qt (react-dom.production.min.js:52)
    at react-dom.production.min.js:53
    at Cr (react-dom.production.min.js:100)
    at Pr (react-dom.production.min.js:101)
    at react-dom.production.min.js:113
    at Lt (react-dom.production.min.js:292)
    at react-dom.production.min.js:50
    at Mr (react-dom.production.min.js:105)
dylanarmstrong commented 3 years ago

Hey @jevakallio, thanks for the issue report.

I'm looking into this now, and it seems to be an issue with this puzzle being 15x16.

dylanarmstrong commented 3 years ago

Hey, this should be good now, want to test it out?

jevakallio commented 3 years ago

@dylanarmstrong yup, that works! 👏