electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 351 forks source link

Uncaught SyntaxError: JSON.parse errors #297

Closed Brodie-Hamilton closed 2 years ago

Brodie-Hamilton commented 2 years ago

šŸž Describe the bug

BUG 1

After deploying a fresh instance of Ackee onto a Vercel instance, on login I get logged back out periodically with the following error:

JSON.parse: unexpected character at line 1 column 1 of the JSON data up/</<@https://my-site-url/index.js:80:80220

BUG 2

Also when attempting to integrate the Ackee tracker into my Svelte-based site (via the embedded JS script method) I get the following error in my browser console when visiting my site:

Uncaught SyntaxError: JSON.parse: expected double-quoted property name at line 1 column 29 of the JSON data

This appears to prevents the tracker from sending any tracking information to my Ackee server as I am getting no data even though I have explicitly disabled the prevention of tracking by setting the options to:

'{ "ignoreLocalhost": false, ignoreOwnVisits: false }'

Confirmed both of the above behaviours in Firefox as well as Chrome.

šŸ“š To Reproduce

  1. Deploy a new instance via steps: https://github.com/electerious/Ackee/blob/master/docs/Get%20started.md#with-vercel
  2. Once configured correctly, attempt to log in.
  3. After login the page logs out periodically with the following error. Appears to only happen on the index page.

šŸ–¼ļø Screenshots

Screen Shot 2021-10-30 at 4 27 02 pm

āš™ļø Environment

electerious commented 2 years ago

It would be interesting to know what the server responds with. Could you take a look at the network inspector of the browser? It should contain a request to /api with a non JSON response.

Another helpful indicator is the serverless function log in Vercel. It should tell us more about the error.

electerious commented 2 years ago

Closing this issue, because I need the serverless function log.