Open tibineagu opened 9 months ago
The original useGtm directive is returning essentially an instance of GtmSupport, which is built to handle server-side calls.
useGtm
GtmSupport
However, it will only return an object if it's been instantiated, and that only happens in the install method.
install
Because for your nuxt approach, you chose to only install the plugin on the client, this is breaking the server-side use of useGtm.
While i know that there is no actual utility of useGtm on the server-side, it would still be great if we didn't have to ensure all calls of gtm.* are done on the client side.
gtm.*
We have a similar problem. In addition, it seems Vite is removing the gtm object entirely when minifying - since it isn't defined.
The original
useGtm
directive is returning essentially an instance ofGtmSupport
, which is built to handle server-side calls.However, it will only return an object if it's been instantiated, and that only happens in the
install
method.Because for your nuxt approach, you chose to only install the plugin on the client, this is breaking the server-side use of
useGtm
.While i know that there is no actual utility of
useGtm
on the server-side, it would still be great if we didn't have to ensure all calls ofgtm.*
are done on the client side.