-
Notifications
You must be signed in to change notification settings - Fork 4
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
useGtm() is randomly undefined #14
Comments
Now I've figured out how to reproduce the error explicitly. |
Having same issue. Appears to be an issue only in dev environment though. |
I got the same issue. |
I got the same issue. |
Same here with Nuxt 3.9. Any way to resovle this? |
It seems Vite does something unexpected when minifying code. (For me, it copied the useGtm function instead of importing it, but useGtm was relying on a locally scoped variable.) |
The GTM snippet is always loaded and the TrackView Event via router sync is always fired.
But I have the problem, that useGtm() inside vue components is randomly undefined.
If I stop and start the development server (npm run dev) several times or clear the cache (npx nuxi cleanup), it eventually works again.
When I then restart the development server again later, it doesn't work again.
What could be the problem.
The text was updated successfully, but these errors were encountered: