Skip to content
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

Error when building with firebase #6655

Closed
billcastillo opened this issue Mar 14, 2019 · 8 comments · Fixed by #8246
Closed

Error when building with firebase #6655

billcastillo opened this issue Mar 14, 2019 · 8 comments · Fixed by #8246
Assignees
Milestone

Comments

@billcastillo
Copy link

billcastillo commented Mar 14, 2019

Running npm run build or deploying to now generates the error below
I made a small repo here

To replicate issue:

  1. npm install
  2. npm run build

Additional notes:

  • npm run dev works fine, locally. I can't deploy due to error.
  • Removing target: 'serverless' removes the error on build but I can't deploy it without the serverless config
  • I am using rebase from @tylermcginnis
Failed to compile.

./node_modules/@firebase/database/dist/index.node.cjs.js
Module not found: Can't resolve 'request' in '/Users/next -firebase/node_modules/@firebase/database/dist'

> Build error occurred
Error: > Build failed because of webpack errors
    at Object.build [as default] (/Users/next-firebase/node_modules/next/dist/build/index.js:99:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! create-next-example-app@ build: `next build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the create-next-example-app@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@eddiebeazer
Copy link

I'm also having this same problem with the Firebase Hosting example. Would love to hear your solution to this problem if you found one.

@kheruc
Copy link
Contributor

kheruc commented Mar 14, 2019

It looks like this import in index.js is causing the deployment problem:

import { database } from 'firebase';

The file doesn't seem to be using this import at all, so you can safely remove it. I can see you are importing individual firebase packages correctly via the rebase.js file.

Without this line, the deployment is successful, but the app still doesn't work. It's probably related to this:
https://spectrum.chat/next-js/general/import-firebase-firestore-causing-error-on-the-client~5a0570ff-1ccc-4abd-b23a-01272344154f

@Timer
Copy link
Member

Timer commented Jun 14, 2019

We're adding support for Firebase in serverless soon, we'll post here when we have an update!

@Timer Timer self-assigned this Jun 14, 2019
@kjkurtz
Copy link

kjkurtz commented Jun 18, 2019

@Timer Is there a workaround in the mean time? Thanks!

@scemii
Copy link

scemii commented Jul 2, 2019

@Timer hey sorry to bodder you Joe, is there any fix encounter soon? (all good on dev server, but still cannot build using firebase even old versions).
Many thanks

@Timer
Copy link
Member

Timer commented Jul 3, 2019

@scemii hey! We finalized some changes needed, but we're focusing on releasing Next 9 right now. 🙏

This is one of our high priority items right after 9.0 ships!

@michel-p
Copy link

@Timer Hi, thank you for the support ! Do you have any ETA for this ?

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
8 participants