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

require_optional module usage replacement fix for next-auth

Notifications You must be signed in to change notification settings

valosan/require-optional-next-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]",
  ...
}

About

require_optional module usage replacement fix for next-auth

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%