Skip to content

require_optional module usage replacement fix for next-auth"

Notifications You must be signed in to change notification settings

huksley/require-optional-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 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: "require-optional-mongodb",
    };

    return config;
  },
};

About

require_optional module usage replacement fix for next-auth"

Resources

Stars

Watchers

Forks

Packages

No packages published