TypeError in gtm plugin: undefined is not an object
See original GitHub issueI have no idea why do I continue to get errors ‘TypeError: undefined is not an object (evaluating ‘n[t].src.match’)’. Example of report in bugsnag: https://i.imgur.com/cLfm60Y.png https://i.imgur.com/H2pgIDn.png It refers to this lines in source code:
const scripts = document.querySelectorAll('script[src]')
return !!Object.keys(scripts).filter(key => scripts[key].src.match(regex)).length
I can’t even imagine when scripts[key].src
in these lines could be undefined.
Anyway, we can replace scripts[key].src.match
with (scripts[key].src || '').match
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
[ErrorScreen] undefined is not an object (evaluating ...
Hi,. I am facing a issue in my mobile application,. Often i am getting this screen. and the error log says this.
Read more >undefined is not an object (evaluating 'tracker.get')
I have code straight from the google analytics docs. For some reason get an error, only sometimes undefined is not an object (evaluating ......
Read more >Is Google Tag Manager Preview Mode Not Working? 22 Ways ...
Is Google Tag Manager Preview mode not working? Here are 22 ways to solve this problem and continue working on your GTM implementation....
Read more >I cannot get an error to go away caused by Google Tag Manager
I go to inspect a page on my site and go to "Console" and I see this error: Uncaught TypeError: Cannot set property...
Read more >Uncaught TypeError: Cannot read property of undefined
Out of the six primitive types defined in JavaScript, namely boolean, string, symbol, number, Null, and undefined, no other type throws as ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published to
@analytics/google-tag-manager@0.2.3
https://github.com/DavidWells/analytics/releases/tag/%40analytics%2Fgoogle-tag-manager%400.2.3
Let me know if that doesn’t fix it 😃
So far so good.