Comments (4)
Thanks for the quick reply @sshah98. The code in my admin.js
is as follows
const express = require("express"); const admin = require("firebase-admin"); admin.initializeApp(); var db = admin.firestore(); module.exports = { admin, db };
However, I am getting the same error
from classsed-react-firebase-client.
I'm getting a similar error, it's related to a CORS issue
from classsed-react-firebase-client.
Did anyone find a solution for this?
from classsed-react-firebase-client.
Yeah, the issue is due to the admin.js
file and the service account associated with the functions folder.
Basically, in the functions folder, there is an admin.js
file with the following code (if you set up local testing for functions: ex: firebase serve
)
const admin = require("firebase-admin");
const serviceAccount = require("../db.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://yourUrl.firebaseio.com",
});
const db = admin.firestore();
module.exports = { admin, db };
simply remove the code related to the service account as such:
const admin = require("firebase-admin");
admin.initializeApp();
const db = admin.firestore();
module.exports = { admin, db };
This is what worked for me. Also, be careful if you're on the spark plan not to have too many requests within 100 seconds, otherwise, you'll get a CORS error.
from classsed-react-firebase-client.
Related Issues (20)
- Notification of opening the dialog doesn't trigger again HOT 1
- Comment count doesn't update in Scream component without refreshing HOT 3
- TypeError: Cannot read property 'handle' of undefined HOT 1
- LikeCount is not rendering after change i need to refesh the page for change
- Failed to load resource: the server responded with a status of 403 (). HOT 1
- Theme not loading HOT 2
- profile infos , logout button , edit profile button : haven't been showing HOT 1
- Unable to enter in textboxes in login page
- Error: Request failed with status code 403 - userActions.js:41 HOT 2
- No onClick action associated with the comment button in screamDialog
- How did ScreamDialog get the post with all the fields and the comments from props without passing in?
- Get 500 status on login post with axios
- App showing blank page after deploying to firebase
- I keep getting Blocked by CORS Policy error in the build version. it says No 'Access-Control-Allow-Origin' header is present on the requested resource. HOT 1
- Issues with expiring tokens - How can I persist the user authentication
- Getting an error despite using exact same code. HOT 5
- TypeError: Cannot read property 'map' of undefined HOT 3
- strang error HOT 1
- React Update on Async Rendering
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classsed-react-firebase-client.