I am looking to exclude specific packages from being bundled together in my application. The documentation provides guidance on how to do so:
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['package-name'],
}
module.exports = nextConfig
However, when I attempted to implement this, I encountered an issue:
⚠ Invalid option found in next.config.mjs file:
⚠ The key 'serverExternalPackages' is not recognized
⚠ For more details, please refer to: https://example.com/error-messages
Even though I followed the instructions as stated:
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['package-name'],
}
module.exports = nextConfig
The compiler immediately raised an error upon execution.