plausible / plausible-tracker

Frontend library to interact with Plausible Analytics
https://github.com/plausible/plausible-tracker
MIT License
214 stars 46 forks source link

0.3.7 breaks nuxt.js because of localStorage check #35

Closed mschoeffmann closed 2 years ago

mschoeffmann commented 2 years ago

Versions

Describe the bug

When upgrading the dependencies with npm update, the plausible-tracker module gets updated from 0.3.5 to 0.3.7.

After the update nuxt dev starts without issues, but opening a page results in infinite loading without any error message in the console or browser. Disabling plausible fixes the issue.

Disabling the line const canAccessLocalStorage = typeof window.localStorage?.getItem === 'function'; at node_modules/plausible-tracker/build/module/lib/request.js:13 allows nuxt to work properly again.

Your Environment

ukutaht commented 2 years ago

Thanks for reporting.

I've released 0.3.8 which uses a different pattern to access localStorage. Could you give it a try? Thanks

mschoeffmann commented 2 years ago

Confirmed - it's working in 0.3.8 Thank you!