Verify canary release
Provide environment information
next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
Binaries:
Node: 16.17.1
npm: 9.2.0
Yarn: 1.22.19
pnpm: 7.22.0
Relevant packages:
next: 13.1.4
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
package.json
- "@next/font": "^13.1.4",
- "next": "^13.1.5-canary.2",
next.config.js
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
experimental: {
appDir: true,
},
staticPageGenerationTimeout: 1000,
}
module.exports = nextConfig
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-ubvjrc?file=app%2Flayout.jsx,next.config.js
To Reproduce
- Run
npm install
- Run
npm run build
Sample Execution In StackBlitz:

Describe the Bug
While attempting to run the command npm run build, the following error message pops up:
...
info - Creating an optimized production build
info - Compiled successfully
info - Linting and checking validity of types
info - Collecting page data
info - Generating static pages (24/24)
> Build error occurred
[Error: ENOENT: no such file or directory, rename '/Users/.../.next/export/404.html' -> '/Users/.../.next/server/pages/404.html'] {
errno: -2,
code: 'ENOENT',
syscall: 'rename',
path: '/Users/.../.next/export/404.html',
dest: '/Users/.../.next/server/pages/404.html'
}
info - Finalizing page optimization .%
END OF `npm run build`.
I tried the following multiple solutions in an attempt to resolve the issue, but the error still occurs:
[1] Moved Affected Files Out To Temp Folder /app-backup Instead of Keeping Under /app
- (a) Moved
/app/(error-pages)/404/page.jsx to /app-backup/404/page.jsx
- (b) Error is thrown for the next file instead for
/app/(error-pages)/500/page.jsx
- (c) The same thing happened when I attempted to move the same file for
/app/(error-pages)/500/page.jsx
- (d) The same issue repeats for other files when [1c] was moved.
[2] Reinstalled Node Packages
[3] Added staticPageGenerationTimeout To next.config.js
[4] Attempted Alternative Solutions via NextJS's Issues Docs
[5] Updated NextJs to the Latest Canary Version
- (a) Updated from
"next": "^13.1.4" to "next": "^13.1.5-canary.2"
- (b) Ran thru [2a] -> [2c]. Same results
Expected Behavior
The npm run build process should complete as per normal, especially when all relevant bugs are fixed, which will signal to me that the build will run safely on a server-execution.
Which browser are you using? (if relevant)
Brave Version 1.47.171 Chromium: 109.0.5414.87 (Official Build) (arm64)
How are you deploying your application? (if relevant)
Localhost Only, running npm run build, which executes next build.
Verify canary release
Provide environment information
next infopackage.jsonnext.config.jsWhich area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-ubvjrc?file=app%2Flayout.jsx,next.config.js
To Reproduce
npm installnpm run buildSample Execution In StackBlitz:Describe the Bug
While attempting to run the command
npm run build, the following error message pops up:I tried the following multiple solutions in an attempt to resolve the issue, but the error still occurs:
[1] Moved Affected Files Out To Temp Folder
/app-backupInstead of Keeping Under/app/app/(error-pages)/404/page.jsxto/app-backup/404/page.jsx/app/(error-pages)/500/page.jsx/app/(error-pages)/500/page.jsx[2] Reinstalled Node Packages
package-lock.jsonnode_modulesvianpm installnpm run buildnpm cache verifynpm cache clean[3] Added staticPageGenerationTimeout To
next.config.jsstaticPageGenerationTimeout: 1000,withinnext.config.js[4] Attempted Alternative Solutions via NextJS's Issues Docs
output: 'standalone'error:ENOENT: no such file or directory, lstat .next/server/app#44120output: 'standalone'error:ENOENT: no such file or directory, lstat .next/server/app#44120 (comment)[5] Updated NextJs to the Latest Canary Version
"next": "^13.1.4"to"next": "^13.1.5-canary.2"Expected Behavior
The
npm run buildprocess should complete as per normal, especially when all relevant bugs are fixed, which will signal to me that the build will run safely on a server-execution.Which browser are you using? (if relevant)
Brave Version 1.47.171 Chromium: 109.0.5414.87 (Official Build) (arm64)
How are you deploying your application? (if relevant)
Localhost Only, running
npm run build, which executesnext build.