Prevent unpredictable dependency hosting by explicitly resolve module path on…
Prevent unpredictable dependency hosting by explicitly resolve module path on webpack.ProvidePlugin (#20971) ProvidePlugin replaces certain identifiers with another modules. As a result, 'buffer' and 'process' modules are added as implicit dependencies to all Next.js plugins. This can be problematic. With "Plug'n'Play" strategy, it don't work at all since they fail-fast with implicit dependencies. With "node_modules" strategy, it might seem OK but actually it can be result into unpredictable behavior since in uses dependency [hoisting](https://yarnpkg.com/advanced/lexicon#hoisting). For example, currently users cannot use next-auth plugin with Plug'n'Play strategy:  This patch let Next.js properly handles such cases with `require.resolve`. Closes https://github.com/vercel/next.js/issues/20955 ###### References: - https://github.com/nextauthjs/next-auth/pull/1034
Showing
Please
register
or
sign in
to comment