NextJS Publish Settings broke unexpectedly

I’m getting a page not found error but I didn’t change any deploy settings.

https://nextweather.netlify.app

9:40:57 AM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
9:40:57 AM: build-image tag: v4.14.3
9:40:57 AM: buildbot version: 0a9525e006898c513bdd79a097f61c04604a28eb
9:40:57 AM: Building without cache
9:40:57 AM: Starting to prepare the repo for build
9:40:57 AM: No cached dependencies found. Cloning fresh repo
9:40:57 AM: git clone GitHub - ivanoats/nextweather: Weather station data focused on wind and tide for human powered watercraft
9:40:58 AM: Preparing Git Reference refs/heads/main
9:40:59 AM: Parsing package.json dependencies
9:41:00 AM: Section completed: initializing
9:41:00 AM: Starting build script
9:41:00 AM: Installing dependencies
9:41:00 AM: Python version set to 2.7
9:41:00 AM: Attempting node version ‘lts/*’ from .nvmrc
9:41:00 AM: Downloading and installing node v18.12.1…
9:41:00 AM: Downloading https://nodejs.org/dist/v18.12.1/node-v18.12.1-linux-x64.tar.xz
9:41:01 AM: Computing checksum with sha256sum
9:41:01 AM: Checksums matched!
9:41:04 AM: Now using node v18.12.1 (npm v8.19.2)
9:41:04 AM: Enabling node corepack
9:41:04 AM: Started restoring cached build plugins
9:41:04 AM: Finished restoring cached build plugins
9:41:04 AM: Attempting ruby version 2.7.2, read from environment
9:41:05 AM: Using ruby version 2.7.2
9:41:05 AM: Using PHP version 8.0
9:41:05 AM: No npm workspaces detected
9:41:05 AM: Started restoring cached node modules
9:41:05 AM: Finished restoring cached node modules
9:41:06 AM: Installing NPM modules using NPM version 8.19.2
9:41:07 AM: npm WARN ERESOLVE overriding peer dependency
9:41:07 AM: npm WARN While resolving: react-inspector@5.1.1
9:41:07 AM: npm WARN Found: react@18.2.0
9:41:07 AM: npm WARN node_modules/react
9:41:07 AM: npm WARN react@“18.2.0” from the root project
9:41:07 AM: npm WARN 115 more (@chakra-ui/accordion, @chakra-ui/alert, …)
9:41:07 AM: npm WARN
9:41:07 AM: npm WARN Could not resolve dependency:
9:41:07 AM: npm WARN peer react@“^16.8.4 || ^17.0.0” from react-inspector@5.1.1
9:41:07 AM: npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
9:41:07 AM: npm WARN react-inspector@“^5.1.0” from @storybook/addon-actions@6.5.13
9:41:07 AM: npm WARN node_modules/@storybook/addon-actions
9:41:07 AM: npm WARN
9:41:07 AM: npm WARN Conflicting peer dependency: react@17.0.2
9:41:07 AM: npm WARN node_modules/react
9:41:07 AM: npm WARN peer react@“^16.8.4 || ^17.0.0” from react-inspector@5.1.1
9:41:07 AM: npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
9:41:07 AM: npm WARN react-inspector@“^5.1.0” from @storybook/addon-actions@6.5.13
9:41:07 AM: npm WARN node_modules/@storybook/addon-actions
9:41:07 AM: npm WARN ERESOLVE overriding peer dependency
9:41:07 AM: npm WARN While resolving: @mdx-js/react@1.6.22
9:41:07 AM: npm WARN Found: react@18.2.0
9:41:07 AM: npm WARN node_modules/react
9:41:07 AM: npm WARN react@“18.2.0” from the root project
9:41:07 AM: npm WARN 115 more (@chakra-ui/accordion, @chakra-ui/alert, …)
9:41:07 AM: npm WARN
9:41:07 AM: npm WARN Could not resolve dependency:
9:41:07 AM: npm WARN peer react@“^16.13.1 || ^17.0.0” from @mdx-js/react@1.6.22
9:41:07 AM: npm WARN node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
9:41:07 AM: npm WARN @mdx-js/react@“^1.6.22” from @storybook/addon-docs@6.5.13
9:41:07 AM: npm WARN node_modules/@storybook/addon-docs
9:41:07 AM: npm WARN
9:41:07 AM: npm WARN Conflicting peer dependency: react@17.0.2
9:41:07 AM: npm WARN node_modules/react
9:41:07 AM: npm WARN peer react@“^16.13.1 || ^17.0.0” from @mdx-js/react@1.6.22
9:41:07 AM: npm WARN node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
9:41:07 AM: npm WARN @mdx-js/react@“^1.6.22” from @storybook/addon-docs@6.5.13
9:41:07 AM: npm WARN node_modules/@storybook/addon-docs
9:41:08 AM: npm WARN ERESOLVE overriding peer dependency
9:41:08 AM: npm WARN While resolving: react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN Found: react@18.2.0
9:41:08 AM: npm WARN node_modules/react
9:41:08 AM: npm WARN react@“18.2.0” from the root project
9:41:08 AM: npm WARN 115 more (@chakra-ui/accordion, @chakra-ui/alert, …)
9:41:08 AM: npm WARN
9:41:08 AM: npm WARN Could not resolve dependency:
9:41:08 AM: npm WARN peer react@“^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1” from react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
9:41:08 AM: npm WARN react-element-to-jsx-string@“^14.3.4” from @storybook/react@6.5.13
9:41:08 AM: npm WARN node_modules/@storybook/react
9:41:08 AM: npm WARN
9:41:08 AM: npm WARN Conflicting peer dependency: react@17.0.2
9:41:08 AM: npm WARN node_modules/react
9:41:08 AM: npm WARN peer react@“^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1” from react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
9:41:08 AM: npm WARN react-element-to-jsx-string@“^14.3.4” from @storybook/react@6.5.13
9:41:08 AM: npm WARN node_modules/@storybook/react
9:41:08 AM: npm WARN ERESOLVE overriding peer dependency
9:41:08 AM: npm WARN While resolving: react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN Found: react-dom@18.2.0
9:41:08 AM: npm WARN node_modules/react-dom
9:41:08 AM: npm WARN react-dom@“18.2.0” from the root project
9:41:08 AM: npm WARN 35 more (@chakra-ui/modal, @chakra-ui/portal, …)
9:41:08 AM: npm WARN
9:41:08 AM: npm WARN Could not resolve dependency:
9:41:08 AM: npm WARN peer react-dom@“^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1” from react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
9:41:08 AM: npm WARN react-element-to-jsx-string@“^14.3.4” from @storybook/react@6.5.13
9:41:08 AM: npm WARN node_modules/@storybook/react
9:41:08 AM: npm WARN
9:41:08 AM: npm WARN Conflicting peer dependency: react-dom@17.0.2
9:41:08 AM: npm WARN node_modules/react-dom
9:41:08 AM: npm WARN peer react-dom@“^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1” from react-element-to-jsx-string@14.3.4
9:41:08 AM: npm WARN node_modules/@storybook/react/node_modules/react-element-to-jsx-string
9:41:08 AM: npm WARN react-element-to-jsx-string@“^14.3.4” from @storybook/react@6.5.13
9:41:08 AM: npm WARN node_modules/@storybook/react
9:41:12 AM: npm WARN deprecated source-map-url@0.4.1: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.
9:41:12 AM: npm WARN deprecated source-map-resolve@0.5.3: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
9:41:13 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
9:41:13 AM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
9:41:13 AM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
9:41:13 AM: npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
9:41:17 AM: npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
9:41:19 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
9:41:22 AM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
9:41:22 AM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
9:41:38 AM: added 2575 packages, and audited 2576 packages in 32s
9:41:38 AM: 276 packages are looking for funding
9:41:38 AM: run npm fund for details
9:41:38 AM: 22 vulnerabilities (21 high, 1 critical)
9:41:38 AM: To address issues that do not require attention, run:
9:41:38 AM: npm audit fix
9:41:38 AM: To address all issues (including breaking changes), run:
9:41:38 AM: npm audit fix --force
9:41:38 AM: Run npm audit for details.
9:41:38 AM: NPM modules installed
9:41:38 AM: Creating package sha
9:41:38 AM: Started restoring cached go cache
9:41:38 AM: Finished restoring cached go cache
9:41:38 AM: Installing Go version 1.14.4 (requested 1.14.4)
9:41:45 AM: unset GOOS;
9:41:45 AM: unset GOARCH;
9:41:45 AM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.14.4.linux.amd64’;
9:41:45 AM: export PATH=“/opt/buildhome/.gimme/versions/go1.14.4.linux.amd64/bin:${PATH}”;
9:41:45 AM: go version >&2;
9:41:45 AM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.14.4.linux.amd64.env”
9:41:45 AM: go version go1.14.4 linux/amd64
9:41:45 AM: Detected 1 framework(s)
9:41:45 AM: “next” at version “13.0.3”
9:41:45 AM: Installing missing commands
9:41:45 AM: Verify run directory
9:41:47 AM: ​
9:41:47 AM: ────────────────────────────────────────────────────────────────
9:41:47 AM: Netlify Build
9:41:47 AM: ────────────────────────────────────────────────────────────────
9:41:47 AM: ​
9:41:47 AM: ❯ Version
9:41:47 AM: @netlify/build 28.1.13
9:41:47 AM: ​
9:41:47 AM: ❯ Flags
9:41:47 AM: baseRelDir: true
9:41:47 AM: buildId: 63727da7315c680093dc27dc
9:41:47 AM: deployId: 63727da7315c680093dc27de
9:41:47 AM: ​
9:41:47 AM: ❯ Current directory
9:41:47 AM: /opt/build/repo
9:41:47 AM: ​
9:41:47 AM: ❯ Config file
9:41:47 AM: No config file was defined: using default values.
9:41:47 AM: ​
9:41:47 AM: ❯ Context
9:41:47 AM: production
9:41:47 AM: ​
9:41:47 AM: ────────────────────────────────────────────────────────────────
9:41:47 AM: 1. Build command from Netlify app
9:41:47 AM: ────────────────────────────────────────────────────────────────
9:41:47 AM: ​
9:41:47 AM: $ npm run build
9:41:47 AM: > nextweather@0.2.4 build
9:41:47 AM: > next build
9:41:47 AM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
9:41:47 AM: info - Linting and checking validity of types…
9:41:50 AM: info - Creating an optimized production build…
9:41:56 AM: info - Compiled successfully
9:41:56 AM: info - Collecting page data…
9:42:04 AM: info - Generating static pages (0/3)
9:42:04 AM: info - Generating static pages (3/3)
9:42:04 AM: info - Finalizing page optimization…
9:42:05 AM: Creating deploy upload records
9:42:04 AM: Route (pages) Size First Load JS
9:42:04 AM: ┌ ○ / 482 B 181 kB
9:42:04 AM: ├ /_app 0 B 180 kB
9:42:04 AM: ├ ○ /404 212 B 181 kB
9:42:04 AM: ├ λ /api/csv 0 B 180 kB
9:42:04 AM: ├ λ /api/observations 0 B 180 kB
9:42:05 AM: Starting post processing
9:42:04 AM: └ λ /api/tsv 0 B 180 kB
9:42:04 AM: + First Load JS shared by all 180 kB
9:42:04 AM: ├ chunks/framework-0f397528c01bc177.js 45.7 kB
9:42:04 AM: ├ chunks/main-e71c796c4d7cc2e4.js 31.8 kB
9:42:06 AM: Post processing - HTML
9:42:04 AM: ├ chunks/pages/_app-1d6b5cd6aa57e733.js 101 kB
9:42:04 AM: └ chunks/webpack-392295ca5ba71d99.js 1.36 kB
9:42:06 AM: Post processing - header rules
9:42:04 AM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
9:42:06 AM: Post processing - redirect rules
9:42:04 AM: ○ (Static) automatically rendered as static HTML (uses no initial props)
9:42:07 AM: Post processing done
9:42:04 AM: ​
9:42:04 AM: (build.command completed in 17.7s)
9:42:04 AM: ​
9:42:04 AM: ────────────────────────────────────────────────────────────────
9:42:04 AM: 2. Deploy site
9:42:04 AM: ────────────────────────────────────────────────────────────────
9:42:04 AM: ​
9:42:04 AM: Starting to deploy site from ‘.next’
9:42:04 AM: Creating deploy tree
9:42:05 AM: 16 new files to upload
9:42:05 AM: 0 new functions to upload
9:42:05 AM: Site deploy was successfully initiated
9:42:05 AM: ​
9:42:05 AM: (Deploy site completed in 746ms)
9:42:05 AM: ​
9:42:05 AM: ────────────────────────────────────────────────────────────────
9:42:05 AM: Netlify Build Complete
9:42:05 AM: ────────────────────────────────────────────────────────────────
9:42:05 AM: ​
9:42:05 AM: (Netlify Build completed in 18.5s)
9:42:05 AM: Caching artifacts
9:42:05 AM: Started saving node modules
9:42:05 AM: Finished saving node modules
9:42:05 AM: Started saving build plugins
9:42:05 AM: Finished saving build plugins
9:42:05 AM: Started saving pip cache
9:42:05 AM: Finished saving pip cache
9:42:11 AM: Site is live :sparkles:
9:42:05 AM: Started saving emacs cask dependencies
9:42:05 AM: Finished saving emacs cask dependencies
9:42:05 AM: Started saving maven dependencies
9:42:05 AM: Finished saving maven dependencies
9:42:05 AM: Started saving boot dependencies
9:42:06 AM: Finished saving boot dependencies
9:42:06 AM: Started saving rust rustup cache
9:42:06 AM: Finished saving rust rustup cache
9:42:06 AM: Started saving go dependencies
9:42:06 AM: Finished saving go dependencies
9:42:06 AM: Build script success
9:42:06 AM: Section completed: building
9:42:09 AM: Uploading Cache of size 376.2MB
9:42:11 AM: Section completed: cleanup
9:42:11 AM: Finished processing build request in 1m14.388553159s

Hi @ivanoats,
First of all delete the package-lock.json file in your project repository.

Finally update Next.js and create a file called netlify.toml in your project repository. The content of the netlify.toml file should look like the code below.

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

Redeploy your application and it should display as expected.
Let me know the outcome.

Thanks.

That worked, thank you. It would be nice to get notifications of things changing if possible.

Hi @ivanoats, glad to know the suggestion helped resolve the problem.

Even though most of the configurations are indicated in the Netlify documentation or blog posts, the Netlify support forum is always ready to help in case you have any problems.

Also updates are communicated in the forum as a banner on the homepage or support guide posts whenever the need arises.

Thanks.

1 Like