#Crash: /export/_next/<id> folder is empty after `npx next build` with `output: 'export'`
1 messages · Page 1 of 1 (latest)
Based on the knowledge sources provided, it seems like there are several issues that could be causing this problem.
-
There might be a bug in the version of Next.js you're using. Some users have reported similar issues with certain versions of Next.js, particularly with the
output: 'export'configuration (source (https://github.com/vercel/next.js/issues/51664), source (https://github.com/vercel/next.js/issues/61343), source (https://github.com/vercel/next.js/issues/48207), source (https://github.com/vercel/next.js/issues/61905), source (https://github.com/vercel/next.js/issues/56823), source (https://github.com/vercel/next.js/issues/48711), source (https://github.com/vercel/next.js/issues/50931)). -
The issue might be related to the presence of a
middleware.tsfile. One user reported that the static site still looks for data json files whenmiddleware.tsis present, even though theoutput: 'export'does not create_next/datafolders (source (https://github.com/vercel/next.js/issues/61343)). -
The issue might be related to the use of
next export -o <dir>. One user reported that the output directory is ignored ifnext.confighasoutput: "export"(source (https://github.com/vercel/next.js/issues/48207)). -
The issue might be related to the use of
appDir: true. One user reported that HTML files are missing from the output when usingappDir: true(source (https://github.com/vercel/next.js/issues/48711)). -
The issue might be related to the location of the static directory. One user reported that the static directory is generated at the wrong location, resulting in a 404 not found error for all
*.css,chunks, pre-optimized images, etc. (source (https://github.com/vercel/next.js/issues/56823)).
- The issue might be related to the copying of files. One user suggested that you need to copy the files from
.next/statictostandalone/.next/staticand to copy thepublicfolder tostandalone/public(source (https://github.com/vercel/next.js/issues/50931)).