Skip to content

JavaScript errors on index page only after build #3311

@ataylorme

Description

@ataylorme

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 are production-app.js:72 Uncaught TypeError: Cannot read property 'push' of undefined at e (production-app.js:72) and ReactErrorUtils.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 during gatsby 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 changed
gatsby-ssr.js: not changed

Actual 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 and package-lock.json as well as updating gatsby and Node with no luck.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions