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?
Reading the commit mentioned by @sprintcar13 the message says:
We can now support
next export
forappDir
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With