Skip to content

nested require prevents import with rollup #555

@brewster1134

Description

@brewster1134

i am trying to build an admin interface to my firestore and using rollup to generate the bundled assets. when i follow the steps in the documentation (and additionally trying to use my local emulators based on this github issue), however when either firebase-admin or @google-cloud/firestore are imported, they each contain further require statements. i have tried every possible combination of es6 import syntaxes & multiple rollup plugins, but do not see a solution for using the admin sdk in my app without needing full commonjs support.

perhaps this aspect of firebase does not support being built with these newer bundlers? tyia

w/ bundling firebase admin
app.js
import * as admin from 'firebase-admin';
bundle.js
var firebase = require("./default-namespace");
// ...
module.exports = firebase;
w/ attempting to use firebase admin with firestore emulator
app.js
import { Firestore } from '@google-cloud/firestore'
exception
[!] Error: Unexpected token (Note that you need rollup-plugin-json to import JSON files)
node_modules/@google-cloud/firestore/package.json (2:8)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions