Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The value at .output must be one of: "standalone"

I'm trying to export a build folder in next.js.

NOTE: I'm using the experimental App directory.

As per the docs to export static HTML, I've added this configuration in next.config.js

const nextConfig = {
  output: 'export',
}

but I get the error

warn  - Invalid next.config.js options detected: 
warn  -     The value at .output must be one of: "standalone".

Can anyone help me here?

like image 580
BRS Avatar asked Oct 14 '25 11:10

BRS


2 Answers

Reading the commit mentioned by @sprintcar13 the message says:

We can now support next export for appDir because of the new config added in #46744.

next build isn't exporting the static files for me, but next export is. You can execute it adding a new script to package.json ("export": "next export"), or just typing npx next export on your terminal.

like image 97
Gonzalingui Avatar answered Oct 18 '25 03:10

Gonzalingui


I was just searching around for this error myself and came across your question. After poking around, I noticed the type imports section of the config file and decided to go look at the source code. Lo and behold, the latest commit next.js#47022 was "feat: add output: export support for appDir"

In my case my config starts by importing the config types like so, I presume you are doing the same thing:

/** @type {import('next').NextConfig} */

So the warning appears to be a result of the config validator, not an actual issue. The commit has been merged but is not in the latest version (v13.2.4) as of today, I would assume it will be in the next version of NextJS shortly.

Relevant snippet from next.js#47022 :

packages/next/src/build/utils.ts
1350 ...
1351 +   nextConfigOutput: 'standalone' | 'export'
1352 ...

In the meantime, I think its safe to say there's nothing to worry about.

like image 20
sprintcar13 Avatar answered Oct 18 '25 02:10

sprintcar13