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

navigation.js:173 Uncaught TypeError #21139

Closed
t2ca opened this issue Feb 2, 2020 · 26 comments · Fixed by #21144
Closed

navigation.js:173 Uncaught TypeError #21139

t2ca opened this issue Feb 2, 2020 · 26 comments · Fixed by #21144
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@t2ca
Copy link
Contributor

t2ca commented Feb 2, 2020

Updated my packages today and started getting this error when i click a link on my webpage.

navigation.js:173 Uncaught TypeError: Cannot read property 'getElementsByTagName' of null
    at navigation.js:173

  170 | if (document.title) {
  171 |   pageName = document.title
  172 | }
> 173 | const pageHeadings = document
  174 |   .getElementById(`gatsby-focus-wrapper`)
  175 |   .getElementsByTagName(`h1`)
  176 | if (pageHeadings && pageHeadings.length) {
@t2ca t2ca added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 2, 2020
@hatr1ck
Copy link

hatr1ck commented Feb 2, 2020

Same here

@heart-of-code
Copy link

heart-of-code commented Feb 2, 2020

Appears to have been introduced in this commit:
701222f

Reverting my Gatsby version to 2.18.24 seemed to resolve the crash, though I'm having issues with pages not loading any data when you click a gatsby link. Can't win 'em all I guess

@ehowey
Copy link
Contributor

ehowey commented Feb 2, 2020

Just started hitting this too.

@marcysutton
Copy link
Contributor

Same here, cc @madalynrose.

@Lc0rE
Copy link

Lc0rE commented Feb 2, 2020

I confirm to have hit this issue after upgrading to the latest 2.19.11 release.

@sidharthachatterjee
Copy link
Contributor

Fix incoming

@ZeliosAriex
Copy link

Im having the same issue :(

@hupe1980
Copy link
Contributor

hupe1980 commented Feb 2, 2020

Same here!

@mkidawa
Copy link

mkidawa commented Feb 2, 2020

Experiencing the same issue :<

@shameer-rahman
Copy link

Same here

@sidharthachatterjee
Copy link
Contributor

Fixed and published in gatsby@2.19.12

Apologies for this.

@garrison0
Copy link

I seem to be getting this exact issue even after updating Gatsby to 2.19.12

@t2ca
Copy link
Contributor Author

t2ca commented Feb 3, 2020

Try rm -rf node_modules/
make sure you have the latest version and install again
The issue is with @reach/router: 1.3.0
So you want to make sure you have "@reach/router": "1.2.1"

@garrison0
Copy link

checked for both reach/router and gatsby versions in the dependencies, then removed node_modules and re-installed

still getting the error

@john-tipper
Copy link

Same error for me, I have 2.19.12 and @reach/router: 1.2.1, blown away node_modules and everything else associated with my project and the error is still occurring.

@jodiedoubleday
Copy link

Yea same issue for me, interestingly my project works fine until I start using Gatsby Image, then the problem occurs on my homepage only /pages/index

@kushal9291
Copy link

Same issue. Was working fine until I start using MDXRenderer (gatsby-plugin-mdx)

@legarams
Copy link

Having the same issue

@chamod-gamage
Copy link

Having the same issue appear on a specific set of pages. Same code works fine on a Mac but not on my Windows machine. Tried different versions of Gatsby.

@t2ca t2ca reopened this Feb 20, 2020
@RobertDanielsson
Copy link

RobertDanielsson commented Feb 23, 2020

Having the same issue, "gatsby": "^2.19.19".

Edit: I fixed it. My components filename was "Search.js" and route was navigate("/search"). Renamed my file to search.js and it started working.

@grantmac
Copy link

grantmac commented Feb 24, 2020

Same issue "gatsby": "^2.19.12". Any work arounds as my Link is totally dead?

@LekoArts
Copy link
Contributor

The original issue was solved and the reproduction steps mentioned here cannot reproduce it anymore. If you have further problems you can take a look at #21263 so that we don’t have duplicate issues. Thanks!

@kimichen13
Copy link

Having the same issue, "gatsby": "^2.19.19".

Edit: I fixed it. My components filename was "Search.js" and route was navigate("/search"). Renamed my file to search.js and it started working.

I rename the file in page from Cart.js to cart.js. It works. Thank you.

@EduGomes18
Copy link

I try all the steps above but i still getting this issue D:, rename files to lowercase, put all files in the src/pages root, using gatsby clean and also deleting node_modules and yarn.lock, i don`t know what more can i do to solve this, someone have a diferent way?

@Tony221268
Copy link

still 100% getting this error

@huynhpeter
Copy link

Just started running into this issue as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.