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

Uncaught SyntaxError: Unexpected token when using `withPlausibleProxy` #137

Open gtokman opened 2 weeks ago

gtokman commented 2 weeks ago

When I to proxy with the following config:

const { withPlausibleProxy } = require('next-plausible')

module.exports = withPlausibleProxy()(withBundleAnalyzer(withContentlayer(nextConfig)))

I get the following error:

script.file-downloads.hash.outbound-links.tagged-events.js:1 Uncaught SyntaxError: Unexpected token '<' (at script.file-downloads.hash.outbound-links.tagged-events.js:1:1)

I updated the provider:

  <PlausibleProvider
          domain={domain}
          trackOutboundLinks
          trackFileDownloads
          hash
          taggedEvents
          enabled={domain.indexOf('localhost') !== -1 || undefined}
          trackLocalhost={domain.indexOf('localhost') !== -1}
        />

Unclear if content layer is causing this error or my next version 14.2.7.