Prashant0664 / Blog-website

A Blogging website created using MERN(MongoDB, ExpressJS, ReactJs, NodeJS)
https://allblogapp-project.vercel.app
20 stars 22 forks source link

Uncaught runtime error, how to fix this? #16

Closed KhushiViper02 closed 2 weeks ago

KhushiViper02 commented 5 months ago

Screenshot 2024-05-02 211415 Screenshot 2024-05-02 211436

This screenshots is of :after going live , which shows uncaught runtime error.

Screenshot 2024-05-02 211548 this one is of terminal where on backend side ,it shows : [nodemon] app crashed & on client side it works perfectly.

So, How to solve these errors if you could help it would be great. As I'm a beginner , I don't know how to fix this.. Sorry for disturbance. @Prashant0664 kindly reply.

Prashant0664 commented 5 months ago

Hii @KhushiViper02 , Have you setup the .env file correctly in backend? It includes: MONGO_URI GOOGLE_CLIENT GOOGLE_SECRET COOKIE_KEY TOKEN_SECRET CLOUD_NAME CLOUD_API_KEY CLOUD_API_SECRET PASS REACT_APP_BACKEND_URL

KhushiViper02 commented 5 months ago

Could u plz tell me step - wise procedure of how to setup .env file. Or could u share a video of how to run your project. Plz!

Regards, Khushi Singh

On Thu, 2 May, 2024, 9:43 pm Prashant, @.***> wrote:

Hii @KhushiViper02 https://github.com/KhushiViper02 , Have you setup the .env file correctly in backend? It includes: MONGO_URI GOOGLE_CLIENT GOOGLE_SECRET COOKIE_KEY TOKEN_SECRET CLOUD_NAME CLOUD_API_KEY CLOUD_API_SECRET PASS REACT_APP_BACKEND_URL

— Reply to this email directly, view it on GitHub https://github.com/Prashant0664/Blog-website/issues/16#issuecomment-2090933207, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGYRVBFPSVKVRRDSNCJ5SMLZAJQ2TAVCNFSM6AAAAABHEAD5T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJQHEZTGMRQG4 . You are receiving this because you authored the thread.Message ID: @.***>

Prashant0664 commented 5 months ago

MONGO_URI=[mongo_db_uri] GOOGLE_CLIENT=[google client id generated from google console] GOOGLE_SECRET=[google client id secret(of the same project as client)] COOKIE_KEY=[any hashed string from https://jwtsecret.com/generate ] TOKEN_SECRET=[any secret like 30days] CLOUD_NAME=[cloud name of cloudinary] CLOUD_API_KEY=[cloud api key of cloudinary] CLOUD_API_SECRET=[cloud secret of cloudinary] PASS=[your google app password generated after turning on 2 step verification] REACT_APP_BACKEND_URL=[http://localhost:5000 if used in local machine, otherwise hosted website url (don't put / after url, eg: www.google.com/ is wrong and www.google.com is correct]

You can watch any recent YouTube video to get these keys and ids because it will be too difficult to explain here.

in frontend .env , add

REACT_APP_BACKEND_URL="http://localhost:5000" or url of backend.

To check if backend is connected properly, check console in browser.

[Content may load slowly (~in 2-3 mins) initially because it stores all data in local storage from database]