I want to opt specific packages out of bundling.
The documentation says:
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['package-name'],
}
module.exports = nextConfig
but the compiler says otherwise:
⚠ Invalid next.config.mjs options detected:
⚠ Unrecognized key(s) in object: 'serverExternalPackages'
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
I did try this, of course:
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['package-name'],
}
module.exports = nextConfig
but the compiler immediately throws an error.