This happens when you override config.resolve.alias
. Make sure to retain existing config:
const nextConfig = {
webpack: (config) => {
config.resolve.alias = {
// YOUR CHANGES
// ...
...config.resolve.alias // <-- this fixes the error
};
return config
}
}