diff --git a/test/integration/build-firebase-only-sequentially/pages/page-1.js b/test/integration/build-firebase-only-sequentially/pages/page-1.js
new file mode 100644
index 0000000000000..dd9c28611eea2
--- /dev/null
+++ b/test/integration/build-firebase-only-sequentially/pages/page-1.js
@@ -0,0 +1,2 @@
+import 'firebase/firestore'
+export default () =>
Firebase
diff --git a/test/integration/build-firebase-only-sequentially/pages/page-2.js b/test/integration/build-firebase-only-sequentially/pages/page-2.js
new file mode 100644
index 0000000000000..dd9c28611eea2
--- /dev/null
+++ b/test/integration/build-firebase-only-sequentially/pages/page-2.js
@@ -0,0 +1,2 @@
+import 'firebase/firestore'
+export default () => Firebase
diff --git a/test/integration/build-firebase-only-sequentially/test/index.test.js b/test/integration/build-firebase-only-sequentially/test/index.test.js
new file mode 100644
index 0000000000000..c6ab580e20385
--- /dev/null
+++ b/test/integration/build-firebase-only-sequentially/test/index.test.js
@@ -0,0 +1,37 @@
+/* eslint-env jest */
+/* global jasmine */
+import path from 'path'
+import fs from 'fs-extra'
+import { nextBuild } from 'next-test-utils'
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1
+const appDir = path.join(__dirname, '..')
+const nextConfig = path.join(appDir, 'next.config.js')
+
+describe('Builds with firebase dependency only sequentially', () => {
+ it('Throws an error when building with firebase dependency in parallel', async () => {
+ await fs.writeFile(
+ nextConfig,
+ `module.exports = { experimental: { cpus: 2 } }`
+ )
+ const results = await nextBuild(appDir, [], { stdout: true, stderr: true })
+ expect(results.stdout + results.stderr).toMatch(/Build error occurred/)
+ expect(results.stdout + results.stderr).toMatch(
+ /grpc_node\.node\. Module did not self-register\./
+ )
+ await fs.remove(nextConfig)
+ })
+
+ it('Throws no error when building with firebase dependency in sequence', async () => {
+ await fs.writeFile(
+ nextConfig,
+ `module.exports = { experimental: { cpus: 1 } }`
+ )
+ const results = await nextBuild(appDir, [], { stdout: true, stderr: true })
+ expect(results.stdout + results.stderr).not.toMatch(/Build error occurred/)
+ expect(results.stdout + results.stderr).not.toMatch(
+ /grpc_node\.node\. Module did not self-register\./
+ )
+ await fs.remove(nextConfig)
+ })
+})