0

I am trying to deploy my Next.js app into Netlify using Github, the build succeeds, but when I open the page it says "page not found". Additionally, my repo consists of two files: front_end where my next.js repo lives and back_end where my solidity smart contract lives.

These are my build settings Build settings

How can I ensure that the page is found?

Adriaan
18.2k7 gold badges47 silver badges88 bronze badges
asked Apr 7, 2022 at 10:12

1 Answer 1

3

I found the answer here with my problem by a user kirillibrahim:

https://answers.netlify.com/t/deployment-of-nextjs-website-page-not-found/28870/4

[build]
 command = "npm run build && npm run export"
 publish = "out"

netlify.toml at root folder

"scripts": {
 "export": "next export"
},

package.json at root folder

Build settings for the netlify project;

Build command: npm run build && npm run export

Publish directory: out

answered Apr 8, 2022 at 6:12
Sign up to request clarification or add additional context in comments.

2 Comments

but this is for static export? What about SSR?
I think you just remove the npm run export

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.