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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -