Let me give the answer myself. Coming back to this a week later - I can now see my mistake, which was this line. The right one should have been:
module.exports = withTM(nextConfig);
Let me give the answer myself. Coming back to this a week later - I can now see my mistake, which was this line. The right one should have been:
module.exports = withTM(nextConfig);