Tyler Norlund
Tyler Norlund

Reputation: 458

Gatsby no longer developing due to 'originalFactory.call' is undefined

I can no longer develop my Gatsby site due to:

undefined is not an object (evaluating 'originalFactory.call')

enter image description here

I can build the site, but I cannot load any of the pages while using gatsby develop. I know this has something to do with SSR. Is there a way around this?


EDIT Just realized that when Gatsby-browser.js is removed, it works properly. It won't render properly, but there's no runtime error. Is there anything else I can share to help find an answer?

Upvotes: 2

Views: 2394

Answers (1)

Ferran Buireu
Ferran Buireu

Reputation: 29315

Have you tried the following snippet instead of your onServiceWorkerUpdateReady's function?

export const onServiceWorkerUpdateReady = () => {
  const answer = window.confirm(
    `This application has been updated. ` +
      `Reload to display the latest version?`
  )
  if (answer === true) {
    window.location.reload()
  }
}

Upvotes: 1

Related Questions