Open devklepacki opened 4 months ago
I can't reproduce this. I do not get the <link>
element. Can you share how you are using <PlausibleProvider/>
?
Sure! Maybe that's due to Next 15?
/* package.json */
"next": "15.0.0-rc.0",
"next-plausible": "^3.12.0",
"react": "19.0.0-rc-f994737d14-20240522",
// layout.tsx
import PlausibleProvider from "next-plausible"
...
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<html lang="pl">
<head>
<PlausibleProvider
domain="foobar.pl"
integrity="sha256-0yIPQuNDyhSEo..."
enabled={process.env.VERCEL_ENV === "production"}
trackOutboundLinks={true}
taggedEvents={true}
/>
</head>
I don't insert anything manually. I only use the script itself and a hook in one component:
import { usePlausible } from "next-plausible"
...
export function SearchInput() {
...
const plausible = usePlausible()
...
const performSearch = async (query: string) => {
...
plausible("search", {
props: { query: encodeURIComponent(query) },
})
...
}
...
}
On my website this inserts the two scripts mentioned in the first post.
crossorigin
attribute is properly added to the Plausible script tag itself, but not to thelink prefetch
element:Warning in Chrome console is as follows:
Here's the script itself for comparison: