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

Language toggler code fails on 404 pages #2984

Closed
Trott opened this issue Feb 25, 2020 · 5 comments
Closed

Language toggler code fails on 404 pages #2984

Trott opened this issue Feb 25, 2020 · 5 comments

Comments

@Trott
Copy link
Member

Trott commented Feb 25, 2020

Language toggler JS code errors on 404 resulting in the thank-a-contributor feature never running, and possibly other issues. The toggler should fail gracefully on 404.

Uncaught TypeError: Cannot read property 'textContent' of null
    at main.js:20
    at main.js:35

Refs: #2635 (comment)

@XhmikosR @tniessen

@XhmikosR
Copy link
Contributor

The thing is that I cannot find a way to get the a 404 page locally to reproduce the issue.

AFAICT we just need to check for currentLangElement before this line https://github.com/nodejs/nodejs.org/blob/master/static/js/main.js#L20

@Trott
Copy link
Member Author

Trott commented Feb 25, 2020

The thing is that I cannot find a way to get the a 404 page locally to reproduce the issue.

Looks like it's not failing on the live server anymore either. Weird.....

@Trott
Copy link
Member Author

Trott commented Feb 25, 2020

Looks like it's not failing on the live server anymore either. Weird.....

Oh, it only fails if you leave out the locale (e.g., en) in the URL.

@nschonni
Copy link
Member

Probably not related, but the rewrite rules were updated recently nodejs/build#2195

@ovflowd
Copy link
Member

ovflowd commented Mar 12, 2023

Closing as this behaviour doesn't exist anymore.

@ovflowd ovflowd closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants