Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 487 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 487 Bytes

require_optional replacemenet

This replaces require_optional in next-auth with one which loads mongodb module.

This fix needed so MongoDB can be used as storage provider in next-auth, see nextauthjs/next-auth#887

Usage

Add this to next.config.js

module.exports = {
  webpack: (config) => {
    config.resolve.alias = {
      ...config.resolve.alias,
      require_optional: "require-optional-mongodb",
    };

    return config;
  },
};