I frequently encounter the following error when trying to upload images to post: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Additional info: jpeg file type, Lemmy web interface, desktop PC, Firefox browser.

Any idea what causes this?

  • Ada
    link
    fedilink
    35 months ago

    We were getting them on our instance when images took more than 10 seconds to upload. It was timing out and returning that message

    • @threelonmusketeersOP
      link
      English
      -15 months ago

      You say “were”, past tense. Did you eventually find a fix or a workaround?

    • @threelonmusketeersOP
      link
      English
      1
      edit-2
      5 months ago

      Maybe? The popup doesn’t say what the character was, just that it was unexpected. Is there some error debug dump log I should look at for more info?

      • @[email protected]
        link
        fedilink
        15 months ago

        Use a desktop browser and open the developer tools, specifically the console tab. With the console tab open recreate the error and see if there’s more info output in the console.

  • @[email protected]
    cake
    link
    fedilink
    1
    edit-2
    5 months ago

    Did your file have a BOM (byte order mark)? That’s often a cause for errors like that. I’d fire up a hex editor and take a look.