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

🐛 Views and Likes causes undefined #416

Closed
ModdyLP opened this issue Jan 9, 2023 · 4 comments · Fixed by #429
Closed

🐛 Views and Likes causes undefined #416

ModdyLP opened this issue Jan 9, 2023 · 4 comments · Fixed by #429
Assignees
Labels
bug Something isn't working unreleased

Comments

@ModdyLP
Copy link
Contributor

ModdyLP commented Jan 9, 2023

Describe the bug
I have enabled the views and likes only on posts and not on the home page or any site i don't want to. But now the script got injected and throws an error of undefined. The querySelector can't find the span of the views and likes and causes undefined. There should be a check for undefined.

To Reproduce
Steps to reproduce the behavior:

  1. Enable Views and Likes global on post
  2. Disable it for specific posts
  3. Look in console on load
  4. See error

Expected behavior
If no views or likes activated, they should not show and don't throw an error.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Firfox
  • Version: 108.0.2

Hugo & Blowfish versions
hugo v0.109.0-47b12b83e636224e5e601813ff3e6790c191e371+extended windows/amd64 BuildDate=2022-12-23T10:38:11Z VendorInfo=gohugoio
BlowFish 2.23.1

Additional context

Console Output
Uncaught TypeError: document.querySelectorAll(...)[0] is undefined
    update_views process.min.2166d3adac1679c00a75161830ab5725d3efc0e3d3f8c2453fb01d0907948436c25f0f8a7ad824322fa22f3f9c85fd4d0a1d5c856f53b862157da25a57dc3d52.js:1
    next prebuilt.js:17765
    next prebuilt.js:17093
    jo prebuilt.js:13573
    setTimeout handler*Id.prototype.jo prebuilt.js:13572
    next prebuilt.js:13563
    no prebuilt.js:12120
    Hr prebuilt.js:12083
    _r prebuilt.js:12033
    Wf prebuilt.js:12984
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    promise callback*o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Wf prebuilt.js:12973
    Vf prebuilt.js:12767
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    promise callback*o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Vf prebuilt.js:12754
    Yl prebuilt.js:11497
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    promise callback*o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Yl prebuilt.js:11429
    onMessage prebuilt.js:11025
    lr prebuilt.js:10971
    hr prebuilt.js:10994
    enqueue prebuilt.js:15000
    e prebuilt.js:15033
    promise callback*bp.prototype.Rc prebuilt.js:15033
    enqueue prebuilt.js:15000
    enqueueAndForget prebuilt.js:14978
    hr prebuilt.js:10994
    lr prebuilt.js:10971
    Si prebuilt.js:10390
    Oi prebuilt.js:10614
    t prebuilt.js:10565
    Kt eventtarget.js:351
    jt eventtarget.js:481
    wa webchannelbasetransport.js:369
    Qe webchannelbase.js:2258
    Ue channelrequest.js:951
    Ia channelrequest.js:743
    gb channelrequest.js:603
    Kt eventtarget.js:351
    jt eventtarget.js:481
    zn xhrio.js:910
    cb xhrio.js:867
    Fa xhrio.js:850
    EventHandlerNonNull* xhrio.js:562
    Fe channelrequest.js:578
    fr webchannelbase.js:1750
    Ga webchannelbase.js:1625
    ee run.js:132
    promise callback*Yt run.js:58
    Jt run.js:35
    cr webchannelbase.js:1585
    Qe webchannelbase.js:2291
process.min.2166d3adac1679c00a75161830ab5725d3efc0e3d3f8c2453fb01d0907948436c25f0f8a7ad824322fa22f3f9c85fd4d0a1d5c856f53b862157da25a57dc3d52.js:1:321
    update_views process.min.2166d3adac1679c00a75161830ab5725d3efc0e3d3f8c2453fb01d0907948436c25f0f8a7ad824322fa22f3f9c85fd4d0a1d5c856f53b862157da25a57dc3d52.js:1
    next prebuilt.js:17765
    next self-hosted:1356
    next prebuilt.js:17093
    jo prebuilt.js:13573
    (Async: setTimeout handler)
    jo prebuilt.js:13572
    next prebuilt.js:13563
    no prebuilt.js:12120
    Hr prebuilt.js:12083
    _r prebuilt.js:12033
    <anonym> self-hosted:1406
    Wf prebuilt.js:12984
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    (Async: promise callback)
    o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Wf prebuilt.js:12973
    Vf prebuilt.js:12767
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    (Async: promise callback)
    o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Vf prebuilt.js:12754
    Vf self-hosted:1406
    Yl prebuilt.js:11497
    e tslib.es6.js:102
    e tslib.es6.js:83
    r tslib.es6.js:73
    (Async: promise callback)
    o tslib.es6.js:75
    y tslib.es6.js:76
    y tslib.es6.js:72
    Yl prebuilt.js:11429
    Yl self-hosted:1406
    onMessage prebuilt.js:11025
    lr prebuilt.js:10971
    hr prebuilt.js:10994
    enqueue prebuilt.js:15000
    e prebuilt.js:15033
    (Async: promise callback)
    Rc prebuilt.js:15033
    enqueue prebuilt.js:15000
    enqueueAndForget prebuilt.js:14978
    hr prebuilt.js:10994
    lr prebuilt.js:10971
    Si prebuilt.js:10390
    Oi prebuilt.js:10614
    t prebuilt.js:10565
    Kt eventtarget.js:351
    jt eventtarget.js:481
    wa webchannelbasetransport.js:369
    Qe webchannelbase.js:2258
    Ue channelrequest.js:951
    Ia channelrequest.js:743
    gb channelrequest.js:603
    Kt eventtarget.js:351
    jt eventtarget.js:481
    zn xhrio.js:910
    cb xhrio.js:867
    Fa xhrio.js:850
    <anonym> self-hosted:1356
    (Async: EventHandlerNonNull)
    <anonym> xhrio.js:562
    Fe channelrequest.js:578
    fr webchannelbase.js:1750
    Ga webchannelbase.js:1625
    ee run.js:132
    (Async: promise callback)
    Yt run.js:58
    Jt run.js:35
    cr webchannelbase.js:1585
    Qe webchannelbase.js:2291
@nunocoracao
Copy link
Owner

@ModdyLP thanks, can you clarify something: is this just throwing warnings or actually messing up something up on the page?

@ModdyLP
Copy link
Contributor Author

ModdyLP commented Jan 9, 2023

The Views and Likes indicator does not work anymore and the Like Button also not works. I have activated monitoring with app check but no active implementation only monitoring.
I have tried to implement that, but rollbacked all changes, and make a clean install again. Still this error.

grafik

@nunocoracao nunocoracao changed the title Views and Likes causes undefined 🐛 Views and Likes causes undefined Jan 9, 2023
@nunocoracao nunocoracao self-assigned this Jan 12, 2023
@nunocoracao nunocoracao added the bug Something isn't working label Jan 12, 2023
@nunocoracao nunocoracao linked a pull request Jan 14, 2023 that will close this issue
@nunocoracao nunocoracao added unreleased bug Something isn't working and removed bug Something isn't working unreleased labels Jan 14, 2023
@nunocoracao
Copy link
Owner

fix in dev branch, will be in the next release

@nunocoracao
Copy link
Owner

Re-opening to test "auto-close" when I merge to main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unreleased
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants