angulartics2 icon indicating copy to clipboard operation
angulartics2 copied to clipboard

ERROR ReferenceError: clicky is not defined

Open Zaniyar opened this issue 5 years ago • 4 comments

  • [x] bug report

I am trying to use clicky on my project. But I get this error.

ERROR ReferenceError: clicky is not defined
    at Angulartics2Clicky.pageTrack (angulartics2-clicky.js:31)
    at SafeSubscriber._next (angulartics2-clicky.js:17)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:183)
    at SafeSubscriber.next (Subscriber.js:122)
    at Subscriber._next (Subscriber.js:72)
    at Subscriber.next (Subscriber.js:49)
    at FilterSubscriber._next (filter.js:33)
    at FilterSubscriber.next (Subscriber.js:49)
    at ReplaySubject.next (Subject.js:39)
    at ReplaySubject.nextInfiniteTimeWindow (ReplaySubject.js:29)

Before I got to the error above, I had these errors, which prevented from run:

eeinject not found

in node_modules\angulartics2\fesm2015\angulartics2.js node_modules\angulartics2\clicky\fesm2015\angulartics2-clicky.js

after removing the "ee" from each "eedefinedInjectable" and "eeinject" I could run the project and then in the browser console I got the "clicky is not defined" error.

Zaniyar avatar Sep 29 '19 21:09 Zaniyar

make sure the version of angular you're using is compatible https://github.com/angulartics/angulartics2/blob/master/README.md#dependencies

scttcper avatar Sep 30 '19 03:09 scttcper

@scttcper I think I am using the right versions:

"@angular-redux/store": "^9.0.0",
"@angular/animations": "^7.0.0",
"@angular/cdk": "^7.0.0",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/core": "^7.0.0",
**"angulartics2": "^7.5.2",**

Zaniyar avatar Oct 05 '19 20:10 Zaniyar

I got nothing dog

scttcper avatar Oct 06 '19 01:10 scttcper

I get the same error when using clicky with angular universal. The error happens when running the prerender task which is executed in a node environment. Hence, the scripts are not properly loaded and the clicky symbol doesn't exist.

Is there any way to disable clicky conditionally (i.e. in this case when execution happens in a node environment)?

takahser avatar May 06 '20 20:05 takahser