Deploy stopped working suddenly (page not found)

Hi, this page not found error started happening just this week, and it happens even if I checkout to the last successfully deployed commit.

The main difference I noticed when I downloaded de deployed files, is that now it is missing the _headers and _redirects, and that instead of a “serverless” folder there is a “server” folder. I tried adding _headers and _redirects file under the public folder and they were added to the deploy, but still got the same error.

There were no configurations changes on my side at least, because like I said, even an old commit has the same error.

Another thing is that if I run my application locally with netlify dev it works properly.

Latest deploy preview I tried: https://63daf6ad351f0e36ff9a1f23--wallet-strategy.netlify.app/wallets

next.config.js

/**
 * @type {import('next').NextConfig}
 */
const nextConfiguration = {
  reactStrictMode: true,
  i18n: {
    localeDetection: false,
    locales: ['pt-BR', 'en'],
    defaultLocale: 'pt-BR',
  },
}

module.exports = nextConfiguration

netlify.toml

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

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

[dev]
  targetPort = 3001

build log with netlify cli

  Netlify Build                                                 
────────────────────────────────────────────────────────────────
​
❯ Version
  @netlify/build 29.5.2
​
❯ Flags
  dry: false
  offline: false
​
❯ Current directory
  D:\Guenter\Projects\Lariat\wallet\wallet-strategy
​
❯ Config file
  D:\Guenter\Projects\Lariat\wallet\wallet-strategy\netlify.toml
​
❯ Context
  production
​
❯ Using Next.js Runtime - v4.30.1
​
  1. @netlify/plugin-nextjs (onPreBuild event)                  
────────────────────────────────────────────────────────────────
​
Next.js cache restored.
Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
​
(@netlify/plugin-nextjs onPreBuild completed in 2.9s)
​
  2. build.command from netlify.toml                            
────────────────────────────────────────────────────────────────
​
$ next build
info  - Loaded env from D:\Guenter\Projects\Lariat\wallet\wallet-strategy\.env.local
info  - Linting and checking validity of types...

./src/components/DataTable/index.tsx
119:6  Warning: React Hook React.useMemo has missing dependencies: 'classes.sortableColumn', 'classes.sortedAsc', 'classes.sortedDesc', and 'handleSort'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Header/MenuItems.tsx
54:6  Warning: React Hook React.useMemo has a missing dependency: 'user'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Negotiations/AssetsListWidget.tsx
76:6  Warning: React Hook React.useMemo has a missing dependency: 'wallet.typeStrategy'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Negotiations/BuyListWidget.tsx
165:6  Warning: React Hook React.useMemo has missing dependencies: 'simulateClick', 'styles.currencyField', and 'tCommon'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
227:6  Warning: React Hook React.useMemo has missing dependencies: 'deleteClick', 'styles.topPerforming', and 'tCommon'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Negotiations/charts/VariationGraph.tsx
117:6  Warning: React Hook React.useMemo has a missing dependency: 'labels'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Negotiations/MacroStrategyWidget.tsx
149:6  Warning: React Hook React.useMemo has missing dependencies: 'buildData', 'consolidateClick', 'isConsolidating', 'tCommon', and 'tWalletStrategy'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Negotiations/NegotiationModal.tsx
43:6  Warning: React Hook React.useEffect has a missing dependency: 'initialValues'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Wallet/WalletCard.tsx
119:6  Warning: React Hook React.useMemo has missing dependencies: 'getConsolidationText' and 'handleConsolidate'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Wallet/WalletIncomes.tsx
171:6  Warning: React Hook React.useMemo has missing dependencies: 'props.walletId', 'styles.monthlyIncomes', 'tCommon', and 'tableHeader'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/Wallet/WalletNegotiations.tsx
73:6  Warning: React Hook React.useMemo has a missing dependency: 'tCommon'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/WalletAsset/WalletAssetList.tsx
57:6  Warning: React Hook React.useEffect has a missing dependency: 'buildWalletAssetsArray'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
110:6  Warning: React Hook React.useMemo has a missing dependency: 'assetList'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
136:6  Warning: React Hook React.useMemo has missing dependencies: 'assetList' and 'tWallet'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/pages/wallets/index.tsx
90:6  Warning: React Hook React.useMemo has missing dependencies: 'classes.center', 'handleDelete', 'handleMakeDefault', 'mutate', 'tCommon', and 'tWallet'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/pages/wallets/[walletId]/assets/[assetId]/index.tsx
106:6  Warning: React Hook React.useEffect has a missing dependency: 'walletAssetSwr'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/pages/wallets/[walletId]/assets/[assetId]/negotiations.tsx
376:6  Warning: React Hook React.useMemo has missing dependencies: 'negotiationActions' and 'tCommon'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info  - Creating an optimized production build...
info  - Compiled successfully
info  - Collecting page data...
info  - Generating static pages (0/6)
info  - Generating static pages (1/6)
info  - Generating static pages (2/6)
info  - Generating static pages (4/6)
info  - Generating static pages (6/6)
info  - Finalizing page optimization...

Route (pages)                                                             Size     First Load JS
┌ λ /                                                                     3.16 kB         160 kB
├   /_app                                                                 0 B             157 kB
├ ○ /404                                                                  181 B           157 kB
├ λ /api/assets                                                           0 B             157 kB
├ λ /api/assets/[id]                                                      0 B             157 kB
├ λ /api/assets/[id]/incomes                                              0 B             157 kB
├ λ /api/assets/[id]/splits                                               0 B             157 kB
├ λ /api/assets/wallets                                                   0 B             157 kB
├ λ /api/auth/[...auth0]                                                  0 B             157 kB
├ λ /api/buy-list/[buyListId]/[assetId]                                   0 B             157 kB
├ λ /api/wallets                                                          0 B             157 kB
├ λ /api/wallets/[walletId]                                               0 B             157 kB
├ λ /api/wallets/[walletId]/assets                                        0 B             157 kB
├ λ /api/wallets/[walletId]/assets-batch                                  0 B             157 kB
├ λ /api/wallets/[walletId]/assets/[assetId]                              0 B             157 kB
├ λ /api/wallets/[walletId]/assets/[assetId]/negotiation                  0 B             157 kB
├ λ /api/wallets/[walletId]/assets/[assetId]/negotiation/[negotiationId]  0 B             157 kB
├ λ /api/wallets/[walletId]/buy-list                                      0 B             157 kB
├ λ /api/wallets/[walletId]/consolidate                                   0 B             157 kB
├ λ /api/wallets/[walletId]/export                                        0 B             157 kB
├ λ /api/wallets/[walletId]/make-default                                  0 B             157 kB
├ λ /api/wallets/[walletId]/negotiations                                  0 B             157 kB
├ λ /api/wallets/[walletId]/summary                                       0 B             157 kB
├ λ /api/wallets/import                                                   0 B             157 kB
├ λ /assets                                                               7.6 kB          197 kB
├ λ /wallets                                                              5.28 kB         185 kB
├ λ /wallets/[walletId]                                                   8.79 kB         215 kB
├ λ /wallets/[walletId]/assets/[assetId]                                  13.5 kB         198 kB
├ λ /wallets/[walletId]/assets/[assetId]/incomes                          774 B           192 kB
├ λ /wallets/[walletId]/assets/[assetId]/negotiations                     9.22 kB         206 kB
└ λ /wallets/[walletId]/summary                                           73.8 kB         274 kB
+ First Load JS shared by all                                             157 kB
  ├ chunks/framework-2c79e2a64abdb08b.js                                  45.2 kB
  ├ chunks/main-75b00bf34b20f48f.js                                       27.5 kB
  ├ chunks/pages/_app-28205d0abcd2a026.js                                 83.4 kB
  └ chunks/webpack-59c5c889f52620d6.js                                    819 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)

​
(build.command completed in 43.5s)
​
  3. @netlify/plugin-nextjs (onBuild event)                     
────────────────────────────────────────────────────────────────
​
Could not find source file for page /api/assets/[id]
Could not find source file for page /api/assets
Could not find source file for page /api/wallets/[walletId]/assets/[assetId]
Could not find source file for page /api/wallets/[walletId]/assets/[assetId]/negotiation
Could not find source file for page /api/wallets/[walletId]/assets
Could not find source file for page /api/wallets/[walletId]/buy-list
Could not find source file for page /api/wallets/[walletId]
Could not find source file for page /api/wallets
Patching D:\Guenter\Projects\Lariat\wallet\wallet-strategy\node_modules\next\dist\server\base-server.js
Done
Patching D:\Guenter\Projects\Lariat\wallet\wallet-strategy\node_modules\next\dist\server\next-server.js
Done
Moving static page files to serve from CDN...
Moved 0 files
Netlify configuration property "redirects" value changed to [
  { from: '/_next/static/*', to: '/static/:splat', status: 200 },
  {
    from: '/:locale/_next/static/*',
    to: '/static/:splat',
    status: 200
  },
  {
    from: '/_next/image*',
    query: { url: ':url', w: ':width', q: ':quality' },
    to: '/_ipx/w_:width,q_:quality/:url',
    status: 301
  },
  { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
  { from: '/cache/*', to: '/404.html', status: 404, force: true },
  { from: '/server/*', to: '/404.html', status: 404, force: true },
  { from: '/serverless/*', to: '/404.html', status: 404, force: true },
  { from: '/trace', to: '/404.html', status: 404, force: true },
  { from: '/traces', to: '/404.html', status: 404, force: true },
  {
    from: '/routes-manifest.json',
    to: '/404.html',
    status: 404,
    force: true
  },
  {
    from: '/build-manifest.json',
    to: '/404.html',
    status: 404,
    force: true
  },
  {
    from: '/prerender-manifest.json',
    to: '/404.html',
    status: 404,
    force: true
  },
  {
    from: '/react-loadable-manifest.json',
    to: '/404.html',
    status: 404,
    force: true
  },
  { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },
  {
    from: '/api/*',
    to: '/.netlify/functions/___netlify-handler',
    status: 200
  },
  {
    from: '/favicon-16x16.png',
    to: '/favicon-16x16.png',
    conditions: { Cookie: [Array] },
    status: 200
  },
  {
    from: '/favicon.ico',
    to: '/favicon.ico',
    conditions: { Cookie: [Array] },
    status: 200
  },
  {
    from: '/vercel.svg',
    to: '/vercel.svg',
    conditions: { Cookie: [Array] },
    status: 200
  },
  {
    from: '/___headers',
    to: '/___headers',
    conditions: { Cookie: [Array] },
    status: 200
  },
  {
    from: '/___redirects',
    to: '/___redirects',
    conditions: { Cookie: [Array] },
    status: 200
  },
  {
    from: '/*',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    conditions: { Cookie: [Array] },
    force: true
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/index.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/index.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/assets.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/assets',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/assets.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/assets',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets/:walletId.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets/:walletId',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets/:walletId.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets/:walletId',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets/:walletId/assets/:assetId.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets/:walletId/assets/:assetId',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets/:walletId/assets/:assetId.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets/:walletId/assets/:assetId',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets/:walletId/assets/:assetId/incomes.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets/:walletId/assets/:assetId/incomes',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets/:walletId/assets/:assetId/incomes.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets/:walletId/assets/:assetId/incomes',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets/:walletId/assets/:assetId/negotiations.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets/:walletId/assets/:assetId/negotiations',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets/:walletId/assets/:assetId/negotiations.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets/:walletId/assets/:assetId/negotiations',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/pt-BR/wallets/:walletId/summary.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/wallets/:walletId/summary',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/_next/data/RNz8xmjUmDoNHHcbyKB6V/en/wallets/:walletId/summary.json',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/en/wallets/:walletId/summary',
    to: '/.netlify/functions/___netlify-handler',
    status: 200,
    force: false
  },
  {
    from: '/*',
    to: '/.netlify/functions/___netlify-handler',
    status: 200
  }
].
​
(@netlify/plugin-nextjs onBuild completed in 3.4s)
​
  4. Functions bundling                                         
────────────────────────────────────────────────────────────────
​
Packaging Functions from .netlify\functions-internal directory:
 - _ipx\_ipx.js
 - ___netlify-handler\___netlify-handler.js
 - ___netlify-odb-handler\___netlify-odb-handler.js
​
​
(Functions bundling completed in 1m 17.5s)
​
  5. Edge Functions bundling                                    
────────────────────────────────────────────────────────────────
​
​
(Edge Functions bundling completed in 722ms)
​
  6. @netlify/plugin-nextjs (onPostBuild event)                 
────────────────────────────────────────────────────────────────
​
Next.js cache saved.
​
(@netlify/plugin-nextjs onPostBuild completed in 388ms)
​
  Netlify Build Complete                                        
────────────────────────────────────────────────────────────────
​
(Netlify Build completed in 2m 12.2s)

Thanks in advance!

I figured out how to make it work again. I have been using netlify build and then netlify deploy, but now it only works if I use netlify deploy --build.