Nextjs project returns 404 error

I am trying to deploy a next js application. Apparently the build is done without problems, but when I try to see the deployed application I only see the 404 page. I tried everything but I don’t know what the problem is.

site:
https://testin-producction--dazzling-cascaron-47337f.netlify.app/

log:
7:39:49 PM: Build ready to start
7:39:51 PM: build-image version: a13ca271c42226d886b5d1dc0da3d70cb6ac0627 (focal)
7:39:51 PM: build-image tag: v4.11.0
7:39:51 PM: buildbot version: 28ac1cc020586b1ec2af1c1e9bb64025ce31310b
7:39:51 PM: Fetching cached dependencies
7:39:51 PM: Starting to download cache of 673.0MB
7:39:56 PM: Finished downloading cache in 4.432467664s
7:39:56 PM: Starting to extract cache
7:40:01 PM: Finished extracting cache in 5.143524343s
7:40:01 PM: Finished fetching cache in 9.882005337s
7:40:01 PM: Starting to prepare the repo for build
7:40:02 PM: Preparing Git Reference refs/heads/testin-producction
7:40:03 PM: Parsing package.json dependencies
7:40:04 PM: Starting build script
7:40:04 PM: Installing dependencies
7:40:04 PM: Python version set to 2.7
7:40:04 PM: Started restoring cached node version
7:40:05 PM: Finished restoring cached node version
7:40:05 PM: Attempting node version β€˜lts/fermium’ from .nvmrc
7:40:05 PM: v14.20.1 is already installed.
7:40:05 PM: Now using node v14.20.1 (npm v6.14.17)
7:40:05 PM: Started restoring cached build plugins
7:40:05 PM: Finished restoring cached build plugins
7:40:05 PM: Attempting ruby version 2.7.2, read from environment
7:40:06 PM: Using ruby version 2.7.2
7:40:06 PM: Using PHP version 8.0
7:40:06 PM: Started restoring cached yarn cache
7:40:10 PM: Finished restoring cached yarn cache
7:40:10 PM: No yarn workspaces detected
7:40:10 PM: Started restoring cached node modules
7:40:10 PM: Finished restoring cached node modules
7:40:10 PM: Installing NPM modules using Yarn version 1.22.10
7:40:11 PM: yarn install v1.22.10
7:40:11 PM: [1/5] Validating package.json…
7:40:11 PM: [2/5] Resolving packages…
7:40:11 PM: success Already up-to-date.
7:40:11 PM: $ husky install
7:40:11 PM: husky - Git hooks installed
7:40:11 PM: Done in 0.52s.
7:40:11 PM: NPM modules installed using Yarn
7:40:11 PM: Started restoring cached go cache
7:40:11 PM: Finished restoring cached go cache
7:40:11 PM: Installing Go version 1.17 (requested 1.17)
7:40:17 PM: unset GOOS;
7:40:17 PM: unset GOARCH;
7:40:17 PM: export GOROOT=β€˜/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
7:40:17 PM: export PATH=β€œ/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
7:40:17 PM: go version >&2;
7:40:17 PM: export GIMME_ENV=β€œ/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
7:40:17 PM: go version go1.17 linux/amd64
7:40:17 PM: Installing missing commands
7:40:17 PM: Verify run directory
7:40:18 PM: ​
7:40:18 PM: ────────────────────────────────────────────────────────────────
7:40:18 PM: Netlify Build
7:40:18 PM: ────────────────────────────────────────────────────────────────
7:40:18 PM: ​
7:40:18 PM: ❯ Version
7:40:18 PM: @netlify/build 27.18.6
7:40:18 PM: ​
7:40:18 PM: ❯ Flags
7:40:18 PM: baseRelDir: true
7:40:18 PM: buildId: 63376ffdceafad00099a216f
7:40:18 PM: deployId: 63376ffeceafad00099a2171
7:40:18 PM: ​
7:40:18 PM: ❯ Current directory
7:40:18 PM: /opt/build/repo
7:40:18 PM: ​
7:40:18 PM: ❯ Config file
7:40:18 PM: No config file was defined: using default values.
7:40:18 PM: ​
7:40:18 PM: ❯ Context
7:40:18 PM: production
7:40:18 PM: ​
7:40:18 PM: ────────────────────────────────────────────────────────────────
7:40:18 PM: 1. Build command from Netlify app
7:40:18 PM: ────────────────────────────────────────────────────────────────
7:40:18 PM: ​
7:40:18 PM: $ yarn build
7:40:18 PM: yarn run v1.22.10
7:40:18 PM: $ next build
7:40:19 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
7:40:19 PM: info - Linting and checking validity of types…
7:40:21 PM: ./pages/search/custom-search.tsx
7:40:21 PM: 13:5 Warning: β€˜watch’ is assigned a value but never used. no-unused-vars
7:40:21 PM: ./pages/talent-register/index.tsx
7:40:21 PM: 63:25 Warning: β€˜preloadValues’ is defined but never used. Allowed unused args must match /^_/u. no-unused-vars
7:40:21 PM: 76:5 Warning: β€˜register’ is assigned a value but never used. no-unused-vars
7:40:21 PM: 77:5 Warning: β€˜setValue’ is assigned a value but never used. no-unused-vars
7:40:21 PM: ./components/cards/cat/CatCard.tsx
7:40:21 PM: 23:11 Warning: Do not use <img> element. Use <Image /> from next/image instead. See: no-img-element | Next.js @next/next/no-img-element
7:40:21 PM: 36:13 Warning: Do not use <img> element. Use <Image /> from next/image instead. See: no-img-element | Next.js @next/next/no-img-element
7:40:21 PM: ./components/navigation/header/Header.tsx
7:40:21 PM: 23:28 Warning: β€˜isLoading’ is assigned a value but never used. no-unused-vars
7:40:21 PM: info - Need to disable some ESLint rules? Learn more here: Basic Features: ESLint | Next.js
7:40:24 PM: info - Creating an optimized production build…
7:40:32 PM: info - Compiled successfully
7:40:32 PM: info - Collecting page data…
7:40:35 PM: info - Generating static pages (0/18)
7:40:37 PM: { user: undefined, isAuthenticated: false, isLoading: true }
7:40:37 PM: info - Generating static pages (4/18)
7:40:37 PM: { user: undefined, isAuthenticated: false, isLoading: true }
7:40:37 PM: info - Generating static pages (8/18)
7:40:37 PM: { user: undefined, isAuthenticated: false, isLoading: true }
7:40:37 PM: info - Generating static pages (13/18)
7:40:38 PM: info - Generating static pages (18/18)
7:40:38 PM: info - Finalizing page optimization…
7:40:38 PM: Route (pages) Size First Load JS
7:40:38 PM: β”Œ β—‹ / (1907 ms) 2.24 kB 234 kB
7:40:38 PM: β”œ /_app 0 B 229 kB
7:40:38 PM: β”œ β—‹ /404 182 B 229 kB
7:40:38 PM: β”œ β—‹ /search (1497 ms) 257 B 229 kB
7:40:38 PM: β”œ β—‹ /search/custom-search (1720 ms) 2.55 kB 242 kB
7:40:38 PM: β”” β—‹ /talent-register (2003 ms) 25.3 kB 265 kB
7:40:38 PM: + First Load JS shared by all 240 kB
7:40:38 PM: β”œ chunks/framework-7751730b10fa0f74.js 45.5 kB
7:40:38 PM: β”œ chunks/main-7777549aeb39a548.js 31.9 kB
7:40:38 PM: β”œ chunks/pages/_app-4c694366dc45c00e.js 151 kB
7:40:38 PM: β”œ chunks/webpack-6ef43a8d4a395f49.js 999 B
7:40:38 PM: β”” css/82893ef7ac27239d.css 11.1 kB
7:40:38 PM: β—‹ (Static) automatically rendered as static HTML (uses no initial props)
7:40:38 PM: Done in 19.60s.
7:40:38 PM: ​
7:40:38 PM: (build.command completed in 19.7s)
7:40:38 PM: ​
7:40:38 PM: ────────────────────────────────────────────────────────────────
7:40:38 PM: 2. Deploy site
7:40:38 PM: ────────────────────────────────────────────────────────────────
7:40:38 PM: ​
7:40:38 PM: Starting to deploy site from β€˜.next’
7:40:38 PM: Creating deploy tree
7:40:38 PM: Creating deploy upload records
7:40:38 PM: 27 new files to upload
7:40:38 PM: 0 new functions to upload
7:40:39 PM: Site deploy was successfully initiated
7:40:39 PM: ​
7:40:39 PM: (Deploy site completed in 835ms)
7:40:39 PM: ​
7:40:39 PM: ────────────────────────────────────────────────────────────────
7:40:39 PM: Netlify Build Complete
7:40:39 PM: ────────────────────────────────────────────────────────────────
7:40:39 PM: ​
7:40:39 PM: (Netlify Build completed in 20.5s)
7:40:39 PM: Starting post processing
7:40:39 PM: Caching artifacts
7:40:39 PM: Started saving node modules
7:40:39 PM: Finished saving node modules
7:40:39 PM: Started saving build plugins
7:40:39 PM: Finished saving build plugins
7:40:39 PM: Started saving yarn cache
7:40:39 PM: Post processing - HTML
7:40:40 PM: Post processing - header rules
7:40:40 PM: Post processing - redirect rules
7:40:40 PM: Post processing done
7:40:42 PM: Finished saving yarn cache
7:40:42 PM: Started saving pip cache
7:40:42 PM: Finished saving pip cache
7:40:42 PM: Started saving emacs cask dependencies
7:40:42 PM: Finished saving emacs cask dependencies
7:40:42 PM: Started saving maven dependencies
7:40:42 PM: Finished saving maven dependencies
7:40:42 PM: Started saving boot dependencies
7:40:42 PM: Finished saving boot dependencies
7:40:42 PM: Started saving rust rustup cache
7:40:42 PM: Finished saving rust rustup cache
7:40:42 PM: Started saving go dependencies
7:40:42 PM: Finished saving go dependencies
7:40:42 PM: Build script success
7:40:43 PM: Site is live :sparkles:
7:40:45 PM: Uploading Cache of size 673.1MB
7:40:50 PM: Finished processing build request in 58.588181867s

Hi @francisco.ve1, thanks for posting.
If possible can you share a repository of the project you are trying to deploy?
Thanks.

Did you try to install Next Runtime:

Yes of course.

Hello @francisco.ve1, thanks for sharing the repository.

First of all add the export command to your package.json.

"export": "next export"

Therefore the scripts section in your package.json should now look like the code below.

  "scripts": {
    "dev": "cross-env NODE_OPTIONS='--inspect' next dev",
    "export": "next export",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "prettier": "prettier --write .",
    "prepare": "husky install",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook"
  },

Secondly, add a netlify.toml file in your project root and then add the build command content below;

[build]
    command = "yarn build && yarn export"
    publish = "out"

Alternatively if you don’t want to add a netlify.toml file in your project root, you can set the build settings when you are deploying your site;
Build command: yarn build && yarn export
Publish directory: out

Try the suggestions above and let me know the outcome.
Hope this helps. Thanks.

@clarnx how about projects that have dynamic server side renders? We cant use β€œnext export” in this case, right?

We just deployed a Next JS 10 traditional application, with pages with getServerSidePropd, no build errors, but we get only 404 errors when try to access the main page.

This same project today is running fine in Vercel.

Is there any place where we can view server side logs?

Hi @douglas, thanks for the feedback.

Yes you are right you can’t use next export for server side rendering. If you are using server side rendering then you have to use next build

Therefore if you use a netlify.toml file in your project root, the build command content should be similar to the code below;

[build]
    command = "yarn build"
    publish = ".next"

If you don’t want to add a netlify.toml file in your project root, you can set the build settings when you are deploying your site;
Build command: yarn build
Publish directory: .next

Hope this helps. Thanks.

This configuration is already like this, it came by default:

Temporary url: https://superpro-website-frontend.netlify.app/

Build log:

11:32:41 AM: Build ready to start
11:32:48 AM: build-image version: 8b79b5e0c585f1b3f892b8032389b4b4b188d887 (focal)
11:32:48 AM: build-image tag: v4.14.0
11:32:48 AM: buildbot version: 1e88a9b854b49555d21dc539e2b8bf5fb78a8f57
11:32:48 AM: Fetching cached dependencies
11:32:48 AM: Starting to download cache of 487.6MB
11:32:51 AM: Finished downloading cache in 3.680437581s
11:32:51 AM: Starting to extract cache
11:32:54 AM: Finished extracting cache in 2.515418915s
11:32:54 AM: Finished fetching cache in 6.258444548s
11:32:54 AM: Starting to prepare the repo for build
11:32:54 AM: Preparing Git Reference refs/heads/master
11:32:55 AM: Parsing package.json dependencies
11:32:56 AM: Starting build script
11:32:56 AM: Installing dependencies
11:32:56 AM: Python version set to 2.7
11:32:56 AM: Started restoring cached node version
11:32:57 AM: Finished restoring cached node version
11:32:57 AM: Attempting node version 'lts/fermium' from .nvmrc
11:32:57 AM: v14.20.1 is already installed.
11:32:57 AM: Now using node v14.20.1 (npm v6.14.17)
11:32:57 AM: Enabling node corepack
11:32:57 AM: Started restoring cached build plugins
11:32:57 AM: Finished restoring cached build plugins
11:32:57 AM: Attempting ruby version 2.7.2, read from environment
11:32:58 AM: Using ruby version 2.7.2
11:32:58 AM: Using PHP version 8.0
11:32:58 AM: Started restoring cached yarn cache
11:32:59 AM: Finished restoring cached yarn cache
11:33:00 AM: Installing yarn at version 1.22.19
11:33:00 AM: Preparing yarn@1.22.19 for immediate activation...
11:33:00 AM: No yarn workspaces detected
11:33:00 AM: Started restoring cached node modules
11:33:00 AM: Finished restoring cached node modules
11:33:01 AM: Installing NPM modules using Yarn version 1.22.19
11:33:01 AM: yarn install v1.22.19
11:33:01 AM: [1/4] Resolving packages...
11:33:01 AM: success Already up-to-date.
11:33:01 AM: $ husky install
11:33:01 AM: husky - Git hooks installed
11:33:01 AM: Done in 0.27s.
11:33:01 AM: NPM modules installed using Yarn
11:33:01 AM: Started restoring cached go cache
11:33:01 AM: Finished restoring cached go cache
11:33:01 AM: Installing Go version 1.17 (requested 1.17)
11:33:05 AM: unset GOOS;
11:33:05 AM: unset GOARCH;
11:33:05 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
11:33:05 AM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
11:33:05 AM: go version >&2;
11:33:05 AM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
11:33:05 AM: go version go1.17 linux/amd64
11:33:05 AM: Installing missing commands
11:33:05 AM: Verify run directory
11:33:07 AM: ​
11:33:07 AM: ────────────────────────────────────────────────────────────────
11:33:07 AM:   Netlify Build                                                 
11:33:07 AM: ────────────────────────────────────────────────────────────────
11:33:07 AM: ​
11:33:07 AM: ❯ Version
11:33:07 AM:   @netlify/build 28.1.1
11:33:07 AM: ​
11:33:07 AM: ❯ Flags
11:33:07 AM:   baseRelDir: true
11:33:07 AM:   buildId: 6353fe9177c5360009e0be68
11:33:07 AM:   deployId: 6353fe9177c5360009e0be6a
11:33:07 AM: ​
11:33:07 AM: ❯ Current directory
11:33:07 AM:   /opt/build/repo
11:33:07 AM: ​
11:33:07 AM: ❯ Config file
11:33:07 AM:   No config file was defined: using default values.
11:33:07 AM: ​
11:33:07 AM: ❯ Context
11:33:07 AM:   production
11:33:07 AM: ​
11:33:07 AM: ────────────────────────────────────────────────────────────────
11:33:07 AM:   1. Build command from Netlify app                             
11:33:07 AM: ────────────────────────────────────────────────────────────────
11:33:07 AM: ​
11:33:07 AM: $ yarn build
11:33:07 AM: yarn run v1.22.19
11:33:07 AM: $ next build
11:33:07 AM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
11:33:07 AM: Browserslist: caniuse-lite is outdated. Please run:
11:33:07 AM: npx browserslist@latest --update-db
11:33:07 AM: Why you should do it regularly:
11:33:07 AM: https://github.com/browserslist/browserslist#browsers-data-updating
11:33:07 AM: info  - Checking validity of types...
11:33:09 AM: Browserslist: caniuse-lite is outdated. Please run:
11:33:09 AM:   npx browserslist@latest --update-db
11:33:09 AM:   Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
11:33:13 AM: info  - Creating an optimized production build...
11:33:13 AM: info  - Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
11:33:13 AM: Browserslist: caniuse-lite is outdated. Please run:
11:33:13 AM: npx browserslist@latest --update-db
11:33:13 AM: Why you should do it regularly:
11:33:13 AM: https://github.com/browserslist/browserslist#browsers-data-updating
11:33:13 AM: info  - Using external babel configuration from /opt/build/repo/babel.config.js
11:33:46 AM: info  - Compiled successfully
11:33:46 AM: info  - Collecting page data...
11:33:50 AM: info  - Generating static pages (0/8)
11:33:50 AM: info  - Generating static pages (2/8)
11:33:50 AM: info  - Generating static pages (4/8)
11:33:50 AM: info  - Generating static pages (6/8)
11:33:50 AM: info  - Generating static pages (8/8)
11:33:50 AM: info  - Finalizing page optimization...
11:33:50 AM: Page                                               Size     First Load JS
11:33:50 AM: β”Œ Ξ» /                                              10 kB           427 kB
11:33:50 AM: β”œ   β”” css/1070c573a3ed2159.css                     2.31 kB
11:33:50 AM: β”œ   /_app                                          0 B             138 kB
11:33:50 AM: β”œ β—‹ /404                                           1.47 kB         144 kB
11:33:50 AM: β”œ   β”” css/a794e749fb003546.css                     695 B
11:33:50 AM: β”œ Ξ» /acesso-interno                                4.7 kB          301 kB
11:33:50 AM: β”œ   β”” css/a0c0fa157c9fd1e3.css                     4.39 kB
11:33:50 AM: β”œ β—‹ /acesso-interno/meus-materiais/exercicios      363 B           204 kB
11:33:50 AM: β”œ β—‹ /acesso-interno/montar-prova                   353 B           204 kB
11:33:50 AM: β”œ β—‹ /acesso-professor (366 ms)                     4.4 kB          232 kB
11:33:50 AM: β”œ   β”” css/05b5310ed985f561.css                     2.21 kB
11:33:50 AM: β”œ Ξ» /api/healthcheck                               0 B             138 kB
11:33:50 AM: β”œ Ξ» /api/robots                                    0 B             138 kB
11:33:50 AM: β”œ Ξ» /api/sitemap                                   0 B             138 kB
11:33:50 AM: β”œ Ξ» /banco-de-questoes                             4.57 kB         330 kB
11:33:50 AM: β”œ   β”” css/656ca50205a03152.css                     931 B
11:33:50 AM: β”œ Ξ» /configurar-plano-professor                    18.9 kB         329 kB
11:33:50 AM: β”œ   β”” css/2c4435a5b621d64f.css                     7.05 kB
11:33:50 AM: β”œ Ξ» /depoimentos                                   2.72 kB         306 kB
11:33:50 AM: β”œ   β”” css/7041c0f81fdf1f6c.css                     3.23 kB
11:33:50 AM: β”œ Ξ» /escolha-plano                                 5.87 kB         331 kB
11:33:50 AM: β”œ   β”” css/fdb2a2052f858245.css                     2.59 kB
11:33:50 AM: β”œ Ξ» /fale-conosco                                  4.4 kB          308 kB
11:33:50 AM: β”œ   β”” css/df3e130347e1d06a.css                     3.25 kB
11:33:50 AM: β”œ Ξ» /faq                                           2.59 kB         306 kB
11:33:50 AM: β”œ   β”” css/79d72eee7d17c417.css                     3.22 kB
11:33:50 AM: β”œ β—‹ /instituicao/[id]/configuracao-plano (337 ms)  8.93 kB         223 kB
11:33:50 AM: β”œ   β”” css/3e0772316691fde5.css                     2.48 kB
11:33:50 AM: β”œ β—‹ /instituicao/[id]/editar (338 ms)              274 B           217 kB
11:33:50 AM: β”œ β—‹ /instituicao/cadastro (326 ms)                 271 B           217 kB
11:33:50 AM: β”œ Ξ» /plano-escola                                  1.67 kB         428 kB
11:33:50 AM: β”œ   β”” css/73137780610a0a6e.css                     1.75 kB
11:33:50 AM: β”œ Ξ» /plano-professor                               1.7 kB          428 kB
11:33:50 AM: β”œ   β”” css/10f71819f6571a49.css                     1.8 kB
11:33:50 AM: β”œ Ξ» /politica-privacidade                          1.47 kB         398 kB
11:33:50 AM: β”œ   β”” css/e1c888ea6d74992a.css                     3.27 kB
11:33:50 AM: β”œ Ξ» /sobre                                         2.16 kB         312 kB
11:33:50 AM: β”œ   β”” css/5924e58ea9cc7077.css                     3.25 kB
11:33:50 AM: β”” Ξ» /termos-uso                                    1.46 kB         398 kB
11:33:50 AM:     β”” css/75598db1bc7db231.css                     3.27 kB
11:33:50 AM: + First Load JS shared by all                      138 kB
11:33:50 AM:   β”œ chunks/framework-dc33c0b5493501f0.js           42 kB
11:33:50 AM:   β”œ chunks/main-f440eb38dc2f19f5.js                30.4 kB
11:33:50 AM:   β”œ chunks/pages/_app-fecd81cd202bd0b6.js          63.8 kB
11:33:50 AM:   β”œ chunks/webpack-dce895d7e1b03335.js             2.02 kB
11:33:50 AM:   β”” css/b69e0248a7453313.css                       27.9 kB
11:33:50 AM: Ξ»  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
11:33:50 AM: β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
11:33:50 AM: Done in 43.69s.
11:33:50 AM: ​
11:33:50 AM: (build.command completed in 43.8s)
11:33:50 AM: ​
11:33:50 AM: ────────────────────────────────────────────────────────────────
11:33:50 AM:   2. Deploy site                                                
11:33:50 AM: ────────────────────────────────────────────────────────────────
11:33:50 AM: ​
11:33:50 AM: Starting to deploy site from '.next'
11:33:51 AM: Creating deploy tree 
11:33:51 AM: Creating deploy upload records
11:33:51 AM: 81 new files to upload
11:33:51 AM: 0 new functions to upload
11:33:52 AM: Site deploy was successfully initiated
11:33:52 AM: ​
11:33:52 AM: (Deploy site completed in 1.4s)
11:33:52 AM: ​
11:33:52 AM: ────────────────────────────────────────────────────────────────
11:33:52 AM:   Netlify Build Complete                                        
11:33:52 AM: ────────────────────────────────────────────────────────────────
11:33:52 AM: ​
11:33:52 AM: (Netlify Build completed in 45.3s)
11:33:52 AM: Starting post processing
11:33:52 AM: Caching artifacts
11:33:52 AM: Started saving node modules
11:33:52 AM: Finished saving node modules
11:33:52 AM: Started saving build plugins
11:33:52 AM: Finished saving build plugins
11:33:52 AM: Started saving corepack cache
11:33:52 AM: mv: cannot move '/opt/buildhome/.node/corepack' to '/opt/build/cache/.node/corepack': No such file or directory
11:33:52 AM: Finished saving corepack cache
11:33:52 AM: Started saving yarn cache
11:33:52 AM: Post processing - HTML
11:33:53 AM: Post processing - header rules
11:33:53 AM: Post processing - redirect rules
11:33:53 AM: Post processing done
11:33:54 AM: Finished saving yarn cache
11:33:54 AM: Started saving pip cache
11:33:54 AM: Finished saving pip cache
11:33:54 AM: Started saving emacs cask dependencies
11:33:54 AM: Finished saving emacs cask dependencies
11:33:54 AM: Started saving maven dependencies
11:33:54 AM: Finished saving maven dependencies
11:33:54 AM: Started saving boot dependencies
11:33:54 AM: Finished saving boot dependencies
11:33:54 AM: Started saving rust rustup cache
11:33:54 AM: Finished saving rust rustup cache
11:33:54 AM: Started saving go dependencies
11:33:54 AM: Finished saving go dependencies
11:33:54 AM: Build script success
11:33:55 AM: Uploading Cache of size 487.7MB
11:33:56 AM: Site is live ✨
11:33:59 AM: Finished processing build request in 1m11.117239898s

Hi @douglas, I have tried to go through your source code based on the repository you shared. Looks like you have some syntax errors in your code.
For instance in your index.tsx file in the pages folder, you used the type GetStaticProps but you did not import it.

You can import it using the code below

import { GetStaticProps } from 'next'

Once you fix the above, create a netlify.toml file in your project root and then add the content below.

[[plugins]]
package = "@netlify/plugin-nextjs"

Once you are done redeploy again. Your site should display content after based on my testing.
I also recommend you go through you source code after the problem is resolved for other possible syntax errors.

Let me know the outcome.

Hope this helps thanks.

1 Like

Hi @clarnx , I’m sorry, but I think that you look to the repo provided by another user above.

We don’t use TypeScript in or project.

About your suggestion, if I add the plugin will it be possible to see the error log?

1 Like

@clarnx thanks, now its working.

Adding the @netlify/plugin-nextjs make to work.

It would be interesting if the Netlify interface or documentation suggested explicit use of the plugin for Next JS projects.

Thanks!

1 Like

Hi @douglas.

I’m sorry, but I think that you look to the repo provided by another user above.

That’s true. I mistakenly assumed you were the original poster @francisco.ve1.
Sorry my mistake.

However since the problem you are facing is similar to @francisco.ve1’s problem the solution is still applicable.

@douglas happy to know the problem was resolved by following the suggestions.

To my knowledge, It’s true the documentation does not explicitly mention how to install the Next.js plugin because these days most of the default configurations of Next.js sites should work automatically without installing the plugin.

Sometimes advanced configurations require explicitly or manually installing the plugin.

However Netlify does have blog posts that mention how to deploy Next.js sites using the plugin.

Thanks.