Closed joulev closed 2 years ago
Hey @joulev!
Have you deployed your Nuxt 3 app to Vercel? We automatically inject the script.js
to your deployment when you enabled Vercel Analytics for Audiences on your project.
Yeah the docs is wrong on how to inject to Nuxt 3. But what @joulev you did is correct. Or you can inject using plugin.
@tobiaslins somehow the /va/script.js
wasn't injected automatically.
Relevant issue https://github.com/vercel/analytics/issues/1
Hi, thanks for the responses!
Indeed it looks like the 404 page is also capturing the /va/script.js
and other va
routes. I think I will wait for the official docs on how to handle this matter then.
Since this issue is a duplicate of #1 now, I will close it.
The docs told to use
inject
in amain.js
, but Nuxt 3 doesn't have it. I tried puttinginject()
oronMounted(inject)
toapp.vue
to no avail.The common error message is that
/va/script.js
doesn't exist, which is true. But then, how do I get this file? When I use this package in a Next.js 13 app, the/va/script.js
is (mysteriously but conveniently) created automatically for me, but I don't know how to create it for other frameworks such as Nuxt or SvelteKit.How should I use
inject()
with Nuxt 3?