Tracey Wong
Tracey Wong

Reputation: 19

Gatsby site 'page not found' when deploy on Netlify or Surge

I could run on localhost, however the site could not show up on Netlify and Surge as I tried to push it on Git. Feel free to check my code: https://github.com/treycwong/bean-tracker

I'm not sure if it's partly due to the dependencies in package.json or if I need to install Yarn? If so, some guidance will be helpful.

  1. Added build settings on Netlify
  2. Removed yarn.lock

With Surge, I've followed the instructions, I've deployed it successfully but still the page shows 'page not found'.

Upvotes: 0

Views: 1250

Answers (2)

Leo
Leo

Reputation: 930

I know it's an old post but this could help more than one.

I've just deploy a Gatsby site to Netlify and I got the Page Not Found error.

I fixed it configuring the build settings as following: enter image description here

Once I did it I got a Node error cause Netlify works by default with an old version. So I needed to force to use a newer one setting the Environment variable to the same I'm using locally: enter image description here

Hope it helps to someone else!

Upvotes: 2

talves
talves

Reputation: 14353

Your Netlify setting should be as follows, if you are not going to use yarn.

Publish location: public
Build command: npm run build

/netlify.toml

[build]
  publish = "public"
  command = "npm run build"

Upvotes: 4

Related Questions