-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
JavaScript errors on index page only after build #3311
Comments
KyleAMathews
added a commit
that referenced
this issue
Dec 22, 2017
ghost
assigned KyleAMathews
Dec 22, 2017
ghost
added
the
review
label
Dec 22, 2017
Thanks for the nice reproduction! I'd heard reports of this before but hadn't been able to reproduce it before. Have a PR up which should make this bug go away finally :-) |
ghost
removed
the
review
label
Dec 22, 2017
@KyleAMathews thanks for the quick fix! Just deployed this out and can confirm it's working 💯 |
This was referenced Feb 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
After running
gatsby build
the resulting site has JavaScript errors on the home/index page only. This happens when clicking links to other pages, such as/about/
. The errors seen areproduction-app.js:72 Uncaught TypeError: Cannot read property 'push' of undefined at e (production-app.js:72)
andReactErrorUtils.js:49 Uncaught TypeError: Cannot read property 'push' of undefined at o (production-app.js:87)
.What's odd is I can visit another page, such as
/about/
directly and things load fine. From there I can even navigate back to the home page and then to other pages without issue. This also does not happen duringgatsby develop
I am using
gatsby-link
for creating the links in the header between pages. For example,<Link className="link" to="/about/">About</Link>
This can be seen on the site at https://www.ataylor.me and https://www.ataylor.me/about/.
The source code for the site is here. The logs for the most recent run of
gatsby build
can be found on CircleCI.Environment
Gatsby version:
1.1.28
Node.js version:
8.8.1
Operating System: macOS High Sierra
10.13.2 (17C88)
(locally) and Debian Jessie (CircleCI)File contents (if changed):
gatsby-config.js
package.json
gatsby-node.js
gatsby-browser.js
: not changedgatsby-ssr.js
: not changedActual result
Links created with
gatsby-link
do not work on the home page and throw errors in the browser console.Expected behavior
The link should work as expected.
Steps to reproduce
1. Visit https://www.ataylor.me
2. Click on any link, such as the About page in the header
3. Witness no page change and view browser console errors
Notes
I've tried destroying and re-creating
node_modules
andpackage-lock.json
as well as updating gatsby and Node with no luck.The text was updated successfully, but these errors were encountered: