4lejandrito / next-plausible

Simple integration for https://nextjs.org and https://plausible.io analytics
https://next-plausible.vercel.app
MIT License
603 stars 33 forks source link

Add check in case afterFiles is not defined #87

Closed macklinhrw closed 1 year ago

macklinhrw commented 1 year ago

I got an error when using the withPlausibleProxy wrapper when I had following code:

image

Uncommenting the afterFiles line fixes the error, but adding this check in the wrapper code will prevent the next-plausible from erroring in the first place. Otherwise, the error is a little confusing:

image

4lejandrito commented 1 year ago

Thanks @macklinhrw! Published as next-plausible@3.7.2.