Giter VIP home page Giter VIP logo

fastfeedback's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastfeedback's Issues

Getting a 502 on deployed project; Localhost runs fine

On my localhost project, I am able to get the skeleton state briefly while the data loads so it gives that nice transition. For some reason on my deployed project on Vercel, it never gets past the skeleton stage. On further inspection of the deployed site, I get a 502 console error that I can't figure out why. Looking to just be pointed in the right direction please and thank you!

Dashboard.js

export default function Dashboard() {
  const { user } = useAuth();
  const { data } = useSWR(user ? ['/api/trails', user.token] : null, fetcher);

  if (!data) {
    return (
      <DashboardShell>
        <TrailTableSkeleton />
      </DashboardShell>
    );
  }

  return (
    <DashboardShell>
      {data?.trails?.length ? (
        <TrailsTable trails={data.trails} />
      ) : (
        <EmptyState />
      )}
    </DashboardShell>
  );
}

Trails.js (Sites.js in tutorial)

import { auth } from '../../lib/firebase-admin';
import { getUserTrails } from '../../lib/db-admin';

export default async (req, res) => {
  try {
    const { uid } = await auth.verifyIdToken(req.headers.token);
    const { trails } = await getUserTrails(uid);

    res.status(200).json({ trails });
  } catch (error) {
    res.status(500).json({ error });
  }
};

Google and github authentication

So i stumbled upon a bug in the main site.

I tried to login with github(keep in mind that my github and google accounts use the same email), i logged in successfully with my github account. Then i logged out and signed in with my google account that uses the same email as my github. I logged successfully again. The final step was to try and login with github again but i couldn`t do it.

image

this is the error that was logged in the console.

Cannot read property `map` of undefined; Deployment error, Working good in local environment

Hey, @leerob! Great course, absolutely loving it.

I was facing an issue in Vercel deployment. I've coded along till stream:5 where we setup the feedback page with getStaticPaths() and getStaticProps() methods, The app is running absolutely fine in the local environment. However, it is giving errors on vVercel deployment.

`

22:11:18.362 > Build error occurred
22:11:18.363 TypeError: Cannot read property 'map' of undefined
22:11:18.364 at getStaticPaths (/vercel/workpath0/.next/serverless/pages/p/[siteId].js:198:23)
22:11:18.364 at processTicksAndRejections (internal/process/task_queues.js:97:5)
22:11:18.364 at async buildStaticPaths (/vercel/workpath0/node_modules/next/dist/build/utils.js:17:80)
22:11:18.364 at async Object.isPageStatic (/vercel/workpath0/node_modules/next/dist/build/utils.js:24:549) {
22:11:18.364 type: 'TypeError'
22:11:18.364 }
22:11:18.388 error Command failed with exit code 1.
22:11:18.389 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
22:11:18.398 Error: Command "yarn run build" exited with 1
22:11:20.354 Done with "package.json"
`

I have triple checked everything and since it is working correctly in the local environment, is getStaticPaths() an issue here?

Build error: Service account object must contain a string "project_id" property

Hi @leerob! I love your React 2025 course ๐Ÿ‘

Just a tiny issue that I ran into and failed to find solutions online. I tried deploying my code to Vercel and during build time, this is the error:

type: 'FirebaseAppError',
errorInfo: {
  code: 'app/invalid-credential',
  message: 'Service account object must contain a string "project_id" property.'
},

In my firebase.js and firebase-admin.js, I have set the projectId and project_id respectively.
I have also included the environment variables in .env, .env.local and Vercel environment variable settings.

Starting with Firebase 7.24.0 `user.xa` doesn't return a valid token anymore.

Issue Description

I was updating the dependencies in my app which follows a similar design as Fast Feedback. And when I bumped up the Firebase Lib to a new version (7.17.1 -> 7.24.0), all auth.verifyIdToken(req.headers.token) calls on the server-side started failing with the following error:

Decoding Firebase ID token failed. Make sure you passed the entire string JWT which represents an ID token

After troubleshooting it I found out that the token is fetched via user.xa client-side which doesn't work any longer.

Fast Feedback does the same on this line. I didn't verify it but chances are it's exposed to the same problem.

Fix

The solution that worked for me was fetching the token in the following way instead:

const idTokenResult = await user.getIdTokenResult();
const idToken = idTokenResult.token;

Value for argument "value" is not a valid query constraint. Cannot use "undefined" as a Firestore value. If you want to ignore undefined values, enable `ignoreUndefinedProperties`.

Was watching the stream 7: React 2025 โ€“ Authentication on API Routes (Firebase JWT)

image
I can't seem to figure out this error
Error message when I open feedback page for a particular site: Value for argument "value" is not a valid query constraint. Cannot use "undefined" as a Firestore value. If you want to ignore undefined values, enable ignoreUndefinedProperties.

But when I hard code the uid value which is causing the error it works.
image
Now I can access the page
image

Public repo: https://github.com/jaymehta20/fastfeedback

Developing on GitHub Codespaces

I've forked and set up fastfeedback on my GitHub Codespaces.

But the development experience is not good. I don't know if it's an issue with the project itself or Codespaces.

When I run fastfeedback on my local machine, it runs like a charm.

But on Codespaces, when I do port forwarding to see site preview, the backend compiles almost every time a new page is requested.

But sometimes, it doesn't.

Very strange behavior.

Any one had the same experience?

Error: Value for Argument 'documentPath' is not a valid resource path. Path must be a non-empty string

I subscribed to and am following your course React2025. Excellent course! Much appreciated.

I have successfully coded along with you up to Unit 10 ... and decided to fork your project and run the completed app.

I updated the env,local with my keys. When I start the app, the error noted above is encountered in

db-admin.js Line 34
const doc = await db.collection('sites').doc(siteId).get();

The value of site-id is undefined.

It is not clear to me why the app is even retrieving any sites during startup.

Any guidance would on best way to stand up this app ... I am interested in testing it locally and studying the completed code on the Stripe integration in particular

Thanks You!

Help With Some Refactoring Please

I am trying to modify my code so that instead of sites being listed with random IDs and the authorId inside, I want to set the document ID to the user and have it be an array so every time a user adds a site it gets pushed into there. This is what I have tried:

Adding a site via modal component:

    const { id } = createSite({
      id: newTrail
    });

In my database this is what I have tried to save it:

export const createSite = async (data) => {
  const site = firestore.collection('sites').doc(user.uid);
  const newSite = await site.update({
    userSites: firebase.firestore.FieldValue.arrayUnion(data),
  });
  return site;
};

I am getting a permissions issue and I thought it was the firebase settings but they all seem right as they verify with the user that is currently logged in.

I am trying to do this so that all the sites for any given user are in one document and easier to request from the frontend.

Best practice way to get unauthenticated users auto forwarded to home page?

Hi everyone. Currently, if you are not logged in and you visit /sites or /account you will see a shell of what the page is supposed to look like.

For now, what I have done is just wrap the component in { !user && } to make sure the user is authenticated before it loads. I also put up a "You are currently not logged in" with a button that forwards to the homepage.

What would be the best practice way to check if the user is not validated and route them back to the homepage?

Another attempt I made was a useEffect that would check if the user is valid and if not route them back to the home page. This worked for the most part except refreshing the page would bring you back to the homepage right away and that's not a good experience.

Hoping to get pointed in the right direction, thanks!

Breaking change in Firebase SDK 8.0

While following along the React 2025 course, my app blew up with the error

Attempted import error: 'apps' is not exported from 'firebase/app' (imported as 'firebase').

I looked it up and found out that since Octobre 2020 the a new Firebase SDK version introduced a breaking changes that affects the way it's imported. Explained in link below.
https://firebase.google.com/support/release-notes/js#version_800_-_october_26_2020

I guess it should be updated in this repo.

BTW Thanks for the course Lee, it's great!
Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.