Using rollup to package a pre-configured next-auth library #9540
Unanswered
davidbattalion
asked this question in
Help
Replies: 2 comments 2 replies
-
Did you ever figure out a solution for this? I'm facing the same issue, but so far not found a solution that works |
Beta Was this translation helpful? Give feedback.
2 replies
-
For anyone who stumbles across this issue and isn't able to upgrade to v5, we were able to get this working by changing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My company wants to make a pre-configured next-auth package on a private npm repo. This sounds like a great idea because I can quickly add an npm package that has next-auth already included and pre-configured out of the gate for our servers, just need to provide the secrets.
I'm running into issues though when it comes to building the library. I have it working locally (a vanilla next project just importing the
index.ts
from the project files), but I am unable to do the same with thedist
version.This is my vite config for building the package
I essentially created a preconfigured
AuthOptions
Objectwhich the idea is to be used like so
This works when testing locally, but when I build and I import it into a project, I get
When I look into
company-auth.es.js
output I see this:Which it seems
Qt
is theNextAuth
function. I sense it has something to do with rolling up the dependcy or the wayQt
(NextAuth
) is exported?Beta Was this translation helpful? Give feedback.
All reactions