mtoygar / ember-cli-google-tag-manager

Ember addon to install and configure GoogleTagManager in your app
MIT License
1 stars 7 forks source link

Error: TypeError: Cannot read property 'push' of undefined #21

Open kjgarza opened 3 years ago

kjgarza commented 3 years ago

I keep getting this error when I first run my ember app. Looking at the docs it seem that it my be related to the datalayer, but I cannot see how could one configure that. Can you provide any guidance?

 TypeError: Cannot read property 'push' of undefined
    at Class.trackPageView (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/addon-tree-output/ember-cli-google-tag-manager/services/gtm.js:52:1)
    at RouterService.<anonymous> (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/addon-tree-output/ember-cli-google-tag-manager/instance-initializers/gtm.js:23:1)
    at apply (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/metal/index.js:219:12)
    at RouterService.trigger (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/runtime/lib/mixins/evented.js:107:5)
    at Class.trigger (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/routing/lib/services/router.js:78:12)
    at apply (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/metal/index.js:219:12)
    at Class.trigger (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/runtime/lib/mixins/evented.js:107:5)
    at trigger (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/@ember/-internals/routing/lib/system/router.js:189:18)
    at call (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/backburner.js:272:24)
    at Queue.invoke [as flush] (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/backburner.js:182:21)
    at DeferredActionQueues.flush (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/backburner.js:341:27)
    at Backburner.flush [as _end] (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/backburner.js:785:38)
    at _end (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/backburner.js:516:18)
    at run (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/vendor/babel-polyfill/polyfill.js:4580:1)
    at /var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/vendor/babel-polyfill/polyfill.js:4597:1
    at flush (/var/folders/87/8wjxxcv104g5r4zq46l9tkyr0000gq/T/broccoli-93442GjkzzazJ008g/out-808-broccoli_merge_trees/assets/vendor/babel-polyfill/polyfill.js:1709:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Accessing the datalayer from the console :

image

Running:

DEBUG: Ember             : 3.15.0
DEBUG: Ember Data        : 3.12.4
DEBUG: Ember Bootstrap   : 3.1.0
DEBUG: Ember Simple Auth : 1.9.2
DEBUG: Model Fragments   : 4.0.0
arjenblokzijl commented 1 year ago

@kjgarza same issue here. Could this be related to running in fastboot?