Gatsby: undefined is not an object (evaluating 'r.page')

Created on 7 Jan 2020  路  17Comments  路  Source: gatsbyjs/gatsby

Description

We run a highly-trafficked Gatsby site in production. Recently, we've begun seeing a _massive_ uptick in these errors reported by our error monitoring tool (Sentry): undefined is not an object (evaluating 'r.page'). This happened after we updated Gatsby from v2.17.7 to v2.18.17.

You can find a few of the stack traces here:

These errors occur exclusively for older versions of Chrome on Windows devices. This would seem to point to a polyfill issue, except for the fact that we cannot reproduce it ourselves and even older Chrome versions still have great support for modern JS.

Example browsers (all on Windows XP, Vista, 7, 8, 8.1, or 10):

  • Chrome 50.0.2661
  • Chrome 56.0.2924
  • Chrome 61.0.3163

In the past, we've found errors like these generally correspond to some issue successfully loading the page-data.json file corresponding to a given page. I don't think anyone will be able to tell us exactly what's happening here, but if there are any Gatsby folks who would be able to point us in the direction of what this r.page refers to or might know of any similar issues that could be related, we'd very much appreciate it! Please let us know if any further information might be useful.

Steps to reproduce

We have not been able to reproduce this ourselves. Our website is DataCamp.com if you'd like to give it a shot.

Expected result

We should not be receiving thousands of errors.

Actual result

We are receiving thousands of errors.

Environment

Output of gatsby info --clipboard:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 11.0.0 - ~/.nvm/versions/node/v11.0.0/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v11.0.0/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 79.0.3945.88
    Firefox: 59.0.2
    Safari: 13.0.4
  npmPackages:
    gatsby: ^2.18.17 => 2.18.17 
    gatsby-image: ^2.2.37 => 2.2.37 
    gatsby-plugin-canonical-urls: ^2.1.15 => 2.1.15 
    gatsby-plugin-portal: ^1.0.7 => 1.0.7 
    gatsby-plugin-purgecss: ^4.0.1 => 4.0.1 
    gatsby-plugin-react-helmet: ^3.1.15 => 3.1.15 
    gatsby-plugin-react-svg: ^2.1.2 => 2.1.2 
    gatsby-plugin-sass: ^2.1.26 => 2.1.26 
    gatsby-plugin-sentry: ^1.0.1 => 1.0.1 
    gatsby-plugin-sharp: ^2.3.8 => 2.3.8 
    gatsby-source-apiserver: ^2.1.4 => 2.1.4 
    gatsby-source-filesystem: ^2.1.42 => 2.1.42 
    gatsby-source-graphql: ^2.1.29 => 2.1.29 
    gatsby-source-greenhouse-job-board: ^1.0.3 => 1.0.3 
    gatsby-transformer-sharp: ^2.3.9 => 2.3.9 
    gatsby-transformer-yaml: ^2.2.20 => 2.2.20 
  npmGlobalPackages:
    gatsby-cli: 2.7.40

cc @dandenney @thomascorthouts @slin12

needs reproduction bug

Most helpful comment

We are also seeing this error in Sentry a lot for some of our pages on 8fit.com, on various devices and browsers. We're currently on v2.19.5

All 17 comments

Also, potentially relevant: we use @DSchau's awesome assetPrefix feature.

Same issue here at https://atelierschuteslibres.com/ in Gatsby v2.17

window.onerror 路 TypeError: undefined is not an object (evaluating 'r.page')
https://atelierschuteslibres.com/app-83c1abcf7ffa2be02805.js:1

Happening in various browsers and OS.

  System:
    OS: macOS 10.15.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.12.0 - ~/.nvm/versions/node/v10.15.3/bin/npm
  Languages:
    Python: 2.7.17 - /usr/local/bin/python
  Browsers:
    Chrome: 79.0.3945.117
    Firefox: 71.0
    Safari: 13.0.4
  npmPackages:
    gatsby: ^2.17.15 => 2.17.15
    gatsby-image: ^2.2.33 => 2.2.33
    gatsby-plugin-google-analytics: ^2.1.27 => 2.1.27
    gatsby-plugin-manifest: ^2.2.28 => 2.2.28
    gatsby-plugin-netlify: ^2.1.25 => 2.1.25
    gatsby-plugin-offline: ^3.0.21 => 3.0.21
    gatsby-plugin-react-helmet: ^3.1.15 => 3.1.15
    gatsby-plugin-sharp: ^2.3.0 => 2.3.0
    gatsby-plugin-sitemap: ^2.2.21 => 2.2.21
    gatsby-plugin-styled-components: ^3.1.13 => 3.1.13
    gatsby-plugin-typescript: ^2.1.18 => 2.1.18
    gatsby-source-contentful: ^2.1.59 => 2.1.59
    gatsby-source-filesystem: ^2.1.37 => 2.1.37
    gatsby-transformer-inline-svg: ^0.0.1 => 0.0.1
    gatsby-transformer-sharp: ^2.3.5 => 2.3.5

Edit: actually it seems to only happen in various Chrome versions, in various Windows versions.

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 馃挏

We have not been able to reproduce.

I just got this on v2.15.24

I just got this on v2.15.24

@benawad Were you able to reproduce it or was it only in Sentry?

Just seeing @antoinerousseau's edit now:

Edit: actually it seems to only happen in various Chrome versions, in various Windows versions.

This is what's happening to us also, and it's incredibly confusing. Perhaps some sort of windows-specific browser extension / adblocker / security software that's e.g. interfering with the page-data.json file loading?

@dandenney only one user on sentry

I just tried opening my gatsby site on an older device (iPhone 5S) Safari 7
And got the same issue in the dev tools

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

We are also seeing this error in Sentry a lot for some of our pages on 8fit.com, on various devices and browsers. We're currently on v2.19.5

We also get this on bold.org version 2.19.14

Sorry, but without a reproduction we can't really help :/

@jaredsilver I am closing this issue due to no reproduction. If you could like to reopen it, please create a minimal reproduction and attach it to this issue, and we will be happy to take a look. Thanks!

@RoyalSix you are able to find the line of code in which this happen? Or a stacktrace?

Happens on page load for us on iPhone running iOS 10.3.3. Note: was not able to reproduce on browserstack with iOS 10, but with iOS 7 it did throw: undefined is not an object (evaluating 'r.page'). This results in users seeing a blank page. They do see the static HTML for a split second, but as soon as JS takes over...its over.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

totsteps picture totsteps  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

dustinhorton picture dustinhorton  路  3Comments