NickyMeuleman / gatsby-theme-nicky-blog

A feature rich blogging platform
https://gatsby-theme-nicky-blog.netlify.com/
8 stars 4 forks source link

Sidebar links do not seem to work appropriately #675

Open DSchau opened 1 year ago

DSchau commented 1 year ago

Description

When navigating between pages (it seems to be specific to the digital garden pages), a click on a page does not navigate successfully to the page as one would expect

Reproduction

  1. Go to https://nickymeuleman.netlify.app/garden/aoc2022-day08
  2. Click on a new post (e.g. https://nickymeuleman.netlify.app/garden/aoc2022-day09)
  3. White screen

(Refreshing the page manually with a hard refresh shows the content as would be expected)

When opening up the console, more details are provided, specifically the console logs

react-dom.production.min.js:189 TypeError: Failed to execute 'unobserve' on 'IntersectionObserver': parameter 1 is not of type 'Element'.
    at useActiveId.ts:29:18
    at Array.forEach (<anonymous>)
    at useActiveId.ts:28:15
    at ei (react-dom.production.min.js:240:251)
    at ni (react-dom.production.min.js:244:163)
    at Ss (react-dom.production.min.js:284:388)
    at as (react-dom.production.min.js:268:86)
    at S (scheduler.production.min.js:13:203)
    at MessagePort.R (scheduler.production.min.js:14:128)

note also that there is an additional error (seemingly on all pages?) below, although I believe it's probably unrelated to the page not working as expected.

Uncaught Error: Minified React error #425; visit https://reactjs.org/docs/error-decoder.html?invariant=425 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at Zr (react-dom.production.min.js:118:466)
    at Qu (react-dom.production.min.js:227:369)
    at ks (react-dom.production.min.js:281:85)
    at bs (react-dom.production.min.js:280:450)
    at vs (react-dom.production.min.js:280:320)
    at gs (react-dom.production.min.js:280:180)
    at as (react-dom.production.min.js:268:209)
    at S (scheduler.production.min.js:13:203)
    at MessagePort.R (scheduler.production.min.js:14:128)

unwinding that, the underlying error is:

Text content does not match server-rendered HTML.

Misc.

I found your blog via your Rust posts for Advent of Code, quite nice work! Happy holidays!

DSchau commented 1 year ago

The specific error seems to be firing from this hook: https://github.com/NickyMeuleman/gatsby-theme-nicky-blog/blob/master/theme/src/hooks/useActiveId.ts