79431269

Date: 2025-02-11 20:45:55
Score: 3
Natty:
Report link

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;
Reasons:
  • Has code block (-0.5):
  • Me too answer (2.5): having the same issue
  • Low reputation (1):
Posted by: Thomas Heniart