Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The useGtm composable returns undefined on server #21

Open
tibineagu opened this issue Jan 3, 2024 · 1 comment
Open

The useGtm composable returns undefined on server #21

tibineagu opened this issue Jan 3, 2024 · 1 comment

Comments

@tibineagu
Copy link

The original useGtm directive is returning essentially an instance of GtmSupport, 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 of gtm.* are done on the client side.

@filiphazardous
Copy link

We have a similar problem. In addition, it seems Vite is removing the gtm object entirely when minifying - since it isn't defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants