benwinding / ngx-filemanager

File manager for Angular
https://benwinding.github.io/ngx-filemanager/
MIT License
9 stars 9 forks source link

I tried running this but I couldn't #17

Open ch-hristov opened 3 years ago

ch-hristov commented 3 years ago

Here's the errors I get

./node_modules/ngx-filemanager-client-firebase/__ivy_ngcc__/fesm2015/ngx-filemanager-client-firebase.js:6767:12-23 - Error: export 'apps' (imported as 'apps') was not found in 'firebase/app' (possible exports: default)

./node_modules/ngx-filemanager-client-firebase/__ivy_ngcc__/fesm2015/ngx-filemanager-client-firebase.js:6768:18-25 - Error: export 'apps' (imported as 'apps') was not found in 'firebase/app' (possible exports: default)

My function index.js:


const functions = require("firebase-functions");
const admin = require("firebase-admin");
const express = require("express");
const cors = require("cors");
const fs = require("fs");
const app = express();

admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
const production = process.env.FUNCTIONS_EMULATOR === true;

const ngx = require("ngx-filemanager-api-firebase/public_api");
exports.files_endpoint = functions.https.onRequest(
  ngx.FileManagerEndpointExpress(admin.storage())
);

Dependencies:

  "dependencies": {
    "@angular/animations": "~12.0.2",
    "@angular/cdk": "^12.0.4",
    "@angular/common": "~12.0.2",
    "@angular/compiler": "~12.0.2",
    "@angular/core": "~12.0.2",
    "@angular/fire": "^6.1.5",
    "@angular/forms": "~12.0.2",
    "@angular/material": "^12.0.4",
    "@angular/platform-browser": "~12.0.2",
    "@angular/platform-browser-dynamic": "~12.0.2",
    "@angular/router": "~12.0.2",
    "@firebase/firestore": "^2.3.6",
    "firebase": "^8.6.7",
    "ngx-filemanager-client-firebase": "^10.0.5",
    "rxjs": "~6.6.0",
    "tslib": "^2.1.0",
    "zone.js": "~0.11.4"
  },
benwinding commented 3 years ago

Hi @ch-hristov, Looks like it could be the options, try this small change and see if that works:

const ngx = require("ngx-filemanager-api-firebase/public_api");
exports.files_endpoint = functions.https.onRequest(
-  ngx.FileManagerEndpointExpress(admin.storage())
+  ngx.FileManagerEndpointExpress({storage: admin.storage()})
);

Cheers, Ben