web-vitals
web-vitals copied to clipboard
Accessing app is not supported in Nuxt3
trafficstars
Getting the following error in the console when using this plugin with nuxt 3:
Accessing app is not supported in Nuxt3.
mock @ legacy-app.mjs:4
get @ legacy-app.mjs:88
default @ vitals.client.js:8
(anonymous) @ nuxt.mjs:69
callWithNuxt @ nuxt.mjs:91
applyPlugin @ nuxt.mjs:48
applyPlugins @ nuxt.mjs:57
await in applyPlugins (async)
initApp @ bootstrap.mjs:28
(anonymous) @ bootstrap.mjs:38
And the plugin itself does not work with both vercel and log providers (not tested with google)
I think that the problem is right here: https://github.com/nuxt-community/web-vitals-module/blob/e019d1e364df6ee2f8fbdb234054c485eda2fb0c/src/runtime/vitals.client.mjs#L6
In nuxt/bridge#302 , nuxt.app was renamed to nuxt.vueApp
Hey hey,
I am porting the module to nuxt 3 compatiblity -> https://github.com/nuxt-community/web-vitals-module/issues/43
After some testing I am hoping to see it released next week :)