Why is the standaone folder not created after next build

Viewed 125

I am using next 12.1.* I have both frontend components, as well as backend APIs served using next. I have enabled the output file tracing, by adding output: 'standalone' to my next.js config After next build, the standalone folder is not created, nor the minimalist server.js file mentioned.

What do I need to do to enable this?

1 Answers

I ran into this same issue today. Use the previous experimental attribute outputStandalone. I just tacked it on along with the proposed new way.

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  output: 'standalone',
  experimental: {
    outputStandalone: true,
  }
}

module.exports = nextConfig

Checked the issues and PRs for the repo and came across an update (https://github.com/vercel/next.js/pull/37994/commits/96d8e175c6e3679b3a4a26d224dd5fe6b6c39338) that was only a few days old so it hadn’t made its way into 12.1.6 yet. Then I also happened to notice the link to the with-docker example was on the canary branch.

Related