Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Latest commit

 

History

History
33 lines (24 loc) · 622 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 622 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: "[email protected]",
    };

    return config;
  },
};

Add this to package.json

"dependencies": {
  ...
  "require_optional": "[email protected]",
  ...
}