Next.js: Firebase promises stuck in "pending" during next export

Created on 17 Jul 2018  路  5Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Related to https://github.com/zeit/next.js/issues/2126

When trying to export any project using firebase, as soon as firebase.database() is called, the export gets stuck and won't finish. As mentioned in issue 2126 if I kill the process, the page works fine, so it seems to complete the main process.
I have tried this both in my own project, as well as the learnnextjs-demo, branch firebase-hn.
I've also tried to force break out of the Promise (where I think is the problem, but can't know for sure) with both Promise.reject/resolve and throwing errors.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://nextjs.org/learn/excel/lazy-loading-modules
  2. Follow the instructions
  3. I had to install the latest version of firebase (5.2.0) to get it to install and run in dev
  4. run next build && next export

Expected behavior

To complete the export process.

Screenshots

screenshot-next-export

System information

  • OS: macOS
  • Version of Next.js: 10.5.0 (also tried 9.11.2 and 8.11.3)

Additional context

The the demo project, I added

exportPathMap: function (defaultPathMap) {
  return {
    '/': { page: '/' }
  }
}

...and to my project I'm using nextjs-export-path-map:

exportPathMap: function (defaultPathMap) {
  return defaultPathMap
}

I've experimented with loading all of firebase as well as specific ones:

const firebase: any = await import('firebase')
const firebase: any = await import('firebase/app')
require('firebase/database')

Most helpful comment

It's not released yet, I merged it when I saw your issue. Will do a new release soon.

All 5 comments

I guess this is the same as #4747 fixed by #4749

@timneutkens I updated both projects to latest release of next (6.1.1-canary.1) and got the same result. Am I suppose to make any other changes?

It's not released yet, I merged it when I saw your issue. Will do a new release soon.

@timneutkens With version 6.1.1-canary.2 the export finish and I get a Export successful message 馃憤

Great, will close this then 馃檶

Was this page helpful?
0 / 5 - 0 ratings