You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an internal package which pulls in next-auth our package is bundled using tsup.
We noticed when attempting to import a provider that the providers are using default exports which breaks our implementation.
This problem occurs when library authors compile ES modules that use export default to CommonJS with a transpiler that does not add the module.exports compatibility strategy discussed above (such as tsc itself). Library authors who ship CommonJS to npm are encouraged not to use default exports, or to apply a transform to their output that applies such a compatibility layer.
Essentially:
export = provider
Needs to be added to all of the providers and backported to 4.*
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
We have an internal package which pulls in next-auth our package is bundled using tsup.
We noticed when attempting to import a provider that the providers are using default exports which breaks our implementation.
Essentially:
Needs to be added to all of the providers and backported to
4.*
See:
https://arethetypeswrong.github.io/[email protected]
&
https://blog.andrewbran.ch/default-exports-in-commonjs-libraries/#the-simplest-solution
And:
https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSOnlyExportsDefault.md
Similar problem:
styled-components/styled-components#3437 (comment)
Beta Was this translation helpful? Give feedback.
All reactions