#Crash: /export/_next/<id> folder is empty after `npx next build` with `output: 'export'`

1 messages · Page 1 of 1 (latest)

turbid ferryBOT
#

Hi @spark falcon. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources provided, it seems like there are several issues that could be causing this problem.

  1. 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)).

  2. The issue might be related to the presence of a middleware.ts file. One user reported that the static site still looks for data json files when middleware.ts is present, even though the output: 'export' does not create _next/data folders (source (https://github.com/vercel/next.js/issues/61343)).

  3. The issue might be related to the use of next export -o <dir>. One user reported that the output directory is ignored if next.config has output: "export" (source (https://github.com/vercel/next.js/issues/48207)).

  4. The issue might be related to the use of appDir: true. One user reported that HTML files are missing from the output when using appDir: true (source (https://github.com/vercel/next.js/issues/48711)).

  5. 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)).

#
  1. The issue might be related to the copying of files. One user suggested that you need to copy the files from .next/static to standalone/.next/static and to copy the public folder to standalone/public (source (https://github.com/vercel/next.js/issues/50931)).

Without more specific information about your setup and the exact error message you're seeing, it's hard to provide a more specific solution. However, you might want to try updating to the latest version of Next.js, checking your middleware.ts file, checking your next.config file, checking your appDir setting, checking the location of your static directory, and checking the copying of your files.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: