Skip to content

Build fails when importing Firestore and using target serverless #8797

Description

@Ferezoz

Bug report

Describe the bug

Build fails when importing Firestore and using target: 'serverless' even after upgrading next to at least version 9.0.4 as mentioned here: #6073 (comment).

Module not found: Can't resolve 'memcpy' in '.../node_modules/bytebuffer/dist'

To Reproduce

  1. package.json:
"dependencies": {
    "firebase": "^6.5.0",
    "next": "^9.0.5",
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  },
  1. firebase.js:
import firebase from 'firebase/app';
import 'firebase/firestore';

const config = {
  ...
};

const firebaseApp = !firebase.apps.length
  ? firebase.initializeApp(config)
  : firebase.app();

const firestore = firebaseApp.firestore();

export default firebaseApp;

export { firestore };
  1. next.config.js:
module.exports = {
  target: 'serverless',
};

Expected behavior

Build should succeed.

Screenshots

image

System information

  • Version of Next.js: 9.0.5
  • Version of firebase: 6.5.0

Additional context

It works on local next dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions