stevekinney / think-piece Goto Github PK
View Code? Open in Web Editor NEWA demostration application for working with Firebase and Cloud Firestore
Home Page: https://frontendmasters.com/courses/firebase-react-v2/
A demostration application for working with Firebase and Cloud Firestore
Home Page: https://frontendmasters.com/courses/firebase-react-v2/
I am getting this error from the Authentication component after deploying to Firebase can someone tell me why I am getting this error?
TypeError:Object(...) is not a function
Here is my authentication component
import React, { useContext } from 'react';
import CurrentUser from './CurrentUser';
import SignInAndSignUp from './SignInAndSignUp';
import { UserContext } from '../providers/UserProvider';
const Authentication = ({ loading }) => {
const user = useContext(UserContext);
if (loading) return null;
return (
<div>
{user ? <CurrentUser {...user} /> : <SignInAndSignUp />}
</div>
)
};
export default Authentication;
I'm finished with the course up through the Modifying User Profiles lesson, and cannot seem to log in using the email and password option. I can sign up with them, and am logged in afterward. But if I sign out using auth.signOut() in the console, and try to log back in, nothing happens. The user object in application component's state is undefined. What am I missing?
When you recorded the course, this code: firestore.collection('posts').add(post);
would use the id property as the document id in firebase. This isn't the case anymore. If you use add(), then Firebase will use a generated document ID by Firebase instead of the id you provided, causing getting the document later with firestore.doc('posts/CUSTOMID')
to not retrieve any document.
The way to resolve this and make the course code work as expected, is that you need to create a new document reference "path" with firestore.collection('posts').doc(CUSTOMID)
and then you save it to the database with the set
method. .. so the full code would be firestore.collection('posts').doc(CUSTOMID).set(post)
and post would not contain the id in it's data since it's now the path of the document.
The code we need to update was introduced in the cf06e77ad586367c0cb24ee42a2ed479f2119adc commit and will need to be updated in all subsequent branches.
This setting is deprecated now, maybe it's a good time to edit your readme? Can I make a PR?
Hello,
I'm trying to follow along with the tutorials on Front End Masters. I cannot clone and install this repo becasue of node-gyp errors. The culprit dependency seems to be firbase's grpc dependency. Here's the error from my console.
gyp ERR! stack at ChildProcess.onExit (/home/jordan/.nvm/versions/node/v12.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.104-microsoft-standard
gyp ERR! command "/home/jordan/.nvm/versions/node/v12.18.2/bin/node" "/home/jordan/.nvm/versions/node/v12.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/jordan/repos/think-piece/node_modules/grpc
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/jordan/.nvm/versions/node/v12.18.2/bin/node /home/jordan/.nvm/versions/node/v12.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/jordan/repos/think-piece/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 4.19.104-microsoft-standard
node-pre-gyp ERR! command "/home/jordan/.nvm/versions/node/v12.18.2/bin/node" "/home/jordan/repos/think-piece/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/jordan/repos/think-piece/node_modules/grpc
node-pre-gyp ERR! node -v v12.18.2
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/home/jordan/.nvm/versions/node/v12.18.2/bin/node /home/jordan/.nvm/versions/node/v12.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/jordan/repos/think-piece/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install:node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! /home/jordan/.npm/_logs/2020-08-31T18_43_40_524Z-debug.log
I've tried both yarn and npm. I'm running this on WSL 2 Ubuntu. This error prevents me from following along with the course.
After following ALL the instructions mentioned in this repos. I get this error message after i lunch the application with npm start :
Module not found: Can't resolve 'firebase/app' in 'C:\Users\Ejiwen.com\Documents\GitHub\think-piece\src'
Hello,
Just got this app when I upgraded to Firebase 5.9.0. In the Firebase release notes (link), I didn't see any API changes. It's weird that it's happening. Also upgrade firebase-admin to 6.5.1 and firebase-tools to 6.5.0. That did not fix the problem. Any ideas? Will be on 5.8.X for now.
This issue related to Querying & Updating --> Removing a Post on frontend masters video.
Mins 4:05 ish
const Post = ({ title, content, user, createdAt, stars, comments }).
By not passing id to the props, we will encounter error.
It suppose to be
const Post = ({ title, content, user, createdAt, stars, comments, id })
Hopefully it helps.
Thank you,
firestore
.collection("posts")
.doc(post.id)
.set(post);
no longer works receiving
interestingly enough if i remove post.id from the .doc() it works as expected. Anyone have any idea why this is happening???
ร
FirebaseError: Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: undefined
Steve...
I'm using
"firebase": "^5.7.0",
"firebase-admin": "^6.4.0",
"firebase-tools": "^6.1.2",
Just completed the course lesson on removing a post. I don't get an error but the firebase documents for posts aren't deleted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.