question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Netlify build errors

See original GitHub issue

Resently upgraded gatsby-plugin-robots-txt from 1.5.5 to 1.6.2 and I am getting this Netlify build error:

7:56:33 AM: error "gatsby-plugin-robots-txt" threw an error while running the onPostBuild lifecycle:
7:56:33 AM: Cannot read property 'startsWith' of null
7:56:33 AM:   78 |       new URL(mergedOptions.sitemap)
7:56:33 AM:   79 |     } catch {
7:56:33 AM: > 80 |       mergedOptions.sitemap = new URL(mergedOptions.sitemap.startsWith(pathPrefix) ? mergedOptions.sitemap : path.posix.join(pathPrefix, mergedOptions.sitemap), mergedOptions.host).toString()
7:56:33 AM:      |                                                             ^
7:56:33 AM:   81 |     }
7:56:33 AM:   82 |   }
7:56:33 AM:   83 |

My config is a one-to-one copy of the Netlify example in the docs. Went back to 1.5.6 and everything is fine. I’m assuming it has something to do with the changes in #441 and the docs just need to be updated with a new elimination.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
1-800-jonocommented, Jul 27, 2021

Latest merge was suppose to fix this but is not yet in npm. npm version still at 1.6.8

1reaction
ajmalafifcommented, May 29, 2021

@wildpow thanks for the step-by-step help for this!

~I think it‘s because I don‘t know how to do 2. Disabled Gatsby cache plug-in. which is why I think even though I‘m on 1.5.6 I still get the error~

edit: figured it out @wildpow thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build troubleshooting tips - Netlify Docs
# Build fails with exit status 128 ... Typically this means that we don't have permission to clone the repository you are trying...
Read more >
Deploy failed Netlify - Stack Overflow
Go to: Site settings > Build & deploy > Build image selection > Edit settings. · Choose Ubuntu Xenial 16.05. · Save and...
Read more >
2 ways to overcome deployment problems with React on Netlify
It is because netlify treats any warnings emitted by react as errors therefore failing the build process. I remember ignoring the warnings by ......
Read more >
Occasional Netlify build failures (Build exceeded maximum ...
Problem: I've seen several times where the build from Netlify in PR fails without a build error. In this case, Netlify log ends...
Read more >
How to Deploy a React Router App to Netlify and Fix the ...
Have you ever experienced a “PAGE NOT FOUND” error when trying to ... Netlify helps web developers build and deploy their applications ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found