-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase in Next.js 14 causes Error: Cannot find module 'undici' #8323
Comments
Facing the same issue, I'm using firebase via next-firebase-auth-edge. The issue happens only on production deployments on vercel, for example it doesn't happen when I make a production build locally. Even though my logs are full of Error 500:
And in the devtools network panel i see But the page is served properly and functioning as expected! I don't know if this should be reported for firebase, vercel, or nextjs! but I'm gonna report it on every repo to make sure it gets the needed attention. If it helps anyone, here's the require stack displayed with the error:
|
Thank you for bringing this to our attention. I tried implementing firebase via next-firebase-auth-edge but I wasn't able to experience any error 'Cannot find module undici'. Aside from Auth, are you using any other Firebase products? Also, I noticed a similar issue filed in Vercel repo. Does rolling back the version to |
I have the same issue. Page loads fine but the first load is always a 500 which is poluting the logs. |
@SaizFerri Can you test rolling back your version as mentioned above by @jbalidiong? |
@DellaBitta Issue is that I need at least v14.3.0-canary.24 as that version introduced a critical fix to how cookies are set in the middleware, which I also need for auth. :/ |
Still, if we can pinpoint exactly which version things started to go wrong then we can bring the support case to the Next.js team and ask them what the problem might be. |
@DellaBitta I see what you mean but that app is running on production so I can't easily downgrade the Next.js version there. I can try on our dev env and keep a look at the logs. |
Hi @SaizFerri, that would be very helpful since we can't reproduce it ourselves. Thanks! |
Operating System
macOS 14.5 (23F79)
Browser Version
Version 1.66.118 Chromium: 125.0.6422.147 (Official Build) (arm64)
Firebase SDK Version
10.12.2
Firebase SDK Product:
Auth, Firestore
Describe your project's tooling
Next.js 14, hosted on vercel
Describe the problem
When accessing pages I am getting a 500 error
Cannot find module 'undici'
. If I try to statically generate these pages it they build but when accessing live they do not render and throw a hard 500.If I remove the static generation and run only on a function they still throw a 500 but the page actually loads.
Everything worked fine until I introduced
firebase/auth
into the mixSteps and code to reproduce issue
You will then need to host on Vercel as running locally will not show this issue.
The text was updated successfully, but these errors were encountered: