Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
0
votes
0 answers

deployed mern heroku app not hitting endpoint

I deployed my MERN app on heroku. However, I am only able to hit the login endpoint, the other api ednpoints are not working. I have tried changing the proxy address from my local server "http://127.0.0.1:1000" to my heroku's…
oladimeji
  • 71
  • 1
  • 10
0
votes
0 answers

why is my mern app deployed on heroku using local server

I deployed my MERN app on heroku it is working fine. However, the deployed app uses my local server. when I stop my local server, the deployed app stops working. What am I doing wrongly? Here is my package.json file { "name": "careplan", …
oladimeji
  • 71
  • 1
  • 10
0
votes
0 answers

Unable to verify user token stored in cookie in MERN app

I am trying to verify a logged In user token in my MERN. However, I am getting "undefined" on client-side as API response. When I hit the endpoint http://127.0.0.1:1000/api/v1/users/login in postman to login a user and this endpoint…
oladimeji
  • 71
  • 1
  • 10
0
votes
1 answer

Pre build error cannot solve in my react native app

This is my first app. I cannot resolve errors. Please help me. error show in expo site.
0
votes
1 answer

useContext() returns undefined values -

I have a context file and state file for Products. when I try to use that context in products component it is returning undefined values productContext.js import { createContext } from "react"; const ProductContext = createContext(); export…
0
votes
1 answer

How can I show the user is still Pending (not active yet)?

I created logged in form wherein it will pop-out a toastify when logged in correctly. So my problem right now is I have a logic wherein the user can only access the website when his account is active, but my toastify is not popping correctly. I'm…
Zurcemozz
  • 183
  • 1
  • 9
0
votes
3 answers

JWT token returning undefined in MERN application

I am using JWT token for authentication in my MERN app. when i click on this endpoint "http://127.0.0.1:1000/api/v1/users/login" in postman to login a user and this endpoint "http://127.0.0.1:1000/api/v1/users/verify" to verify a user's token, the…
oladimeji
  • 71
  • 1
  • 10
0
votes
2 answers

How sent cookies

I am trying to send cookies through the backend interface, and when I test it with the Postman, it is done as required. The problem is that cookies are not being sent in the browser. Here is my code: server.js import express from "express"; import…
Zain Alabdeen
  • 479
  • 3
  • 7
0
votes
2 answers

Axios POST Request Gives 400 (Bad Request) Error on React

When I use the postman backend it works fine. But when using React and trying to add data to the database gives a 400 error. When I use the console.log(newpost) it gives a new post object on the console. But I can't send the data to the database.…
0
votes
0 answers

Uncaught TypeError: Cannot read properties of null (reading 'useState')and The above error occurred in the component:

iam getting 3 errors in my console 1.Uncaught TypeError: Cannot read properties of null (reading 'useState') 2.The above error occurred in the component: 3.Get or create chat error TypeError: Cannot read properties of null (reading…
hamsheena
  • 1
  • 2
0
votes
0 answers

How to use dynamic Heroku PORT for Node.js server inside Front-end part of the app?

I'm trying to deploy an app created with the MERN stack on Heroku. The structure of my app: the port for the Back-end (Node.js server) is created in server.js: const port = process.env.PORT || 80; app.listen(port, () => console.log(`Server running…
rumon
  • 466
  • 2
  • 8
  • 21
0
votes
1 answer

When i refresh page my URL back to initial values in MERN stack

I use the MERN stack and I want to create something like this on the frontend: http://localhost:3000/products?color=0000&sort=latest&category=man etc. I'm using the redux toolkit and my getProductSlice looks like this: export const getProducts =…
0
votes
0 answers

Infinite loop from JWT expiring

Hi I'm using this tutorial https://github.com/bradtraversy/mern-tutorial I guess it must have slipped past him, but after 7 days when the JWT expires, the website goes into an infinite loop telling me I'm not authorized. I set the JWT expiration to…
code1331
  • 71
  • 3
0
votes
0 answers

I'm getting a 400 error when I try to create a new Item on my model that is referenced to another model, am i missing data to send to the backend?

I'm creating a full stack MERN stack app, my front end is getting passed down the categories prop which is the model that i'm referencing to create a new Item, which is the model i'm trying to create on. I'm getting a 400 error when I use the form…
Shea Shea
  • 11
  • 1
0
votes
0 answers

When reload the page all data disappears in the page in ReactJS

Uncaught TypeError: Cannot read properties of null (reading 'imageLink') The above error occurred in the component: This Products page Display all the products in the database. When I click on any product card it will redirects…
1 2 3
99
100