title: NextJS - Error: Cannot find module '/<path>/.next/fallback-build-manifest.json' in next.config.js file
body: <p>When adding custom webpack configurations to the <code>next.config.js</code> file for the NextJS I am able to compile fine, except for when adding configurations for <code>plugins</code> for webpack.</p>
  <p>plugin configuration for webpack:</p>
  <pre><code>module.exports = {
    webpack: (config, options) =&gt; {
  
     ... config code ...
  
      config.plugins = [
        new webpack.ProvidePlugin({
          Buffer: [&quot;buffer&quot;, &quot;Buffer&quot;],
          process: &quot;process/browser&quot;,
        }),
      ];
  
     ... config code ...
  
      return config;
    },
  };
  
  </code></pre>
  <p>When uncommenting specifically the plugin lines, webpack compilation is successful. But as stated from a npm package, that line is needed for usage.</p>
  <p>Configuration setup <a href="https://github.com/diegomura/react-pdf#readme" rel="nofollow noreferrer">here</a></p>
  <p>Otherwise the resulting error would be <code>Error: Cannot find module /&lt;path&gt;/.next/fallback-build-manifest.json</code></p>
  <p>Where usually there would be a produced build manifest for the <code>.next</code> folder.</p>