Open george-thomas-hill opened 8 months ago
These issues seem related:
Per . . .
https://github.com/vercel/next.js/issues/58707#issuecomment-1822085059
. . . I tried building using Next.js 14.0.2, but that didn't help; I got the same error.
transpilePackages option fixed this issue for me https://github.com/vercel/next.js/issues/58817#issuecomment-1898843930
Link to the code that reproduces this issue
https://github.com/george-thomas-hill/next-and-firebase-build-error
To Reproduce
I get "Error: Failed to collect page data" when building an app that uses Firebase 10.9.0 and Next.js.
More specifically, the error comes when I import from "firebase/auth/web-extension".
Here is a terminal session that demonstrates reproducing the issue in a minimal installation of Next.js and Firebase.
In the
pico
session initiated in the above terminal session, the only change that I made tosrc/pages/index.js
was the addition of:Current vs. Expected behavior
Current behavior:
npm build
fails at theCollecting page data
step.Expected behavior: The app builds.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
My app is a Chrome extension.
At first, I was able to use Next.js to build my app using Firebase 10.6.0 without any issues.
However, when I submitted my app to the Chrome Web Store, it was rejected because Firebase Auth loads remote code.
I learned that instead of using . . .
. . . I need to use . . .
.
To do that, I had to update my app past Firebase 10.8.0.
Upon doing so, I immediately got the build error detailed above.
I have tried Firebase 10.8.0, 10.8.1, and 10.9.0.
I have also tried Next.js 13.5.6, 14.1.3, and 14.1.4.
I would be grateful for a fix or for a workaround.
Thank you!