For those of you having the same issue with "node:fs", here is a next.config.(m)js that works :
const nextConfig = {
// Your config
webpack: (config, { nextRuntime }) => {
if (nextRuntime !== "nodejs") {
const { IgnorePlugin } = require("webpack");
const ignoreNode = new IgnorePlugin({ resourceRegExp: /node:.*/ });
config.plugins.push(ignoreNode);
}
return config;
},
};
module.exports = nextConfig;