NextJS - Error: Cannot find module '/<path>/.next/fallback-build-manifest.json' in next.config.js file

Viewed 833

When adding custom webpack configurations to the next.config.js file for the NextJS I am able to compile fine, except for when adding configurations for plugins for webpack.

plugin configuration for webpack:

module.exports = {
  webpack: (config, options) => {

   ... config code ...

    config.plugins = [
      new webpack.ProvidePlugin({
        Buffer: ["buffer", "Buffer"],
        process: "process/browser",
      }),
    ];

   ... config code ...

    return config;
  },
};

When uncommenting specifically the plugin lines, webpack compilation is successful. But as stated from a npm package, that line is needed for usage.

Configuration setup here

Otherwise the resulting error would be Error: Cannot find module /<path>/.next/fallback-build-manifest.json

Where usually there would be a produced build manifest for the .next folder.

0 Answers
Related