web-vitals icon indicating copy to clipboard operation
web-vitals copied to clipboard

Accessing app is not supported in Nuxt3

Open roamiiing opened this issue 3 years ago • 2 comments
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)

roamiiing avatar Feb 17 '22 10:02 roamiiing

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

roamiiing avatar Feb 17 '22 11:02 roamiiing

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 :)

Baroshem avatar Mar 28 '22 13:03 Baroshem