functions-samples: Isomorphic React App@AdminSDK: ERROR in ../functions/~/firebase-admin/lib/auth/credential.j

Hi! Due to const firebase = global.firebase || require('firebase'); deprecated, impossible tie new Firebase Admin SDK by reason of webpack errors:

ERROR in ../functions/~/firebase-admin/lib/auth/credential.js
Module not found: Error: Can't resolve 'fs' in '/home/valaoffice/projects/dst-iso/functions/node_modules/firebase-admin/lib/auth'
ERROR in ../functions/~/faye-websocket/lib/faye/websocket/client.js
Module not found: Error: Can't resolve 'net'

and so on. Please give correct webpack.config

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Don’t upgrade to firebase-admin. Switch back to firebase. The code is supposed to run on the client and firebase-admin does not work on a web page.

Here are a few differences:

  • It’s using redux and the react-redux-firebase library
  • It’s authenticating users from the client on the server so that we can pre-render even private data.
  • It’s not packing a server bundle, instead it runs all the files through Babel and simply leaves all the JS files to be uploaded on the server.
  • It has NPM scripts to run in local/dev mode.