Firebase Admin SDK causing build error in React -
i added firebase admin sdk react project (i used create-react-app if makes difference). i'm testing out initialize firebase in index.js
import react 'react'; import reactdom 'react-dom'; import app './app'; import './index.css'; var admin = require("firebase-admin"); var serviceaccount = require("./serviceaccountkey.json"); admin.initializeapp({ credential: admin.credential.cert(serviceaccount), databaseurl: "https://<app-name>.firebaseio.com/" }); reactdom.render( <app />, document.getelementbyid('root') );
everything else in project untouched. go run npm run build
can deploy project firebase hosting , following failed compile error
module not found: error: cannot resolve module 'request' in /home/ubuntu/workspace/shelf/node_modules/firebase-admin/lib/database
any ideas issue here or should solve it? thanks!
Comments
Post a Comment