Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
0
votes
0 answers

notifications concept (bell icon) in MERN app

I have a website that makes users sell thier stuff, so the user can follow other users to recieve a notification if the user posted a post, or someone commented on his post or replied on his comment. I would like to display the notifications in a…
Mubarak B
  • 60
  • 6
0
votes
0 answers

Mern search using regex for data type numbers and date

Working on a project and doing a search for data in the database. The primary search is on year and date data type. But it's not working and telling me resources not found... // Search function const searchKey = search ? { "$or": [ {…
0
votes
0 answers

Connect front-end with back-end

I trying to build project where user can buy product. All my routes on server side are working. (Register, login, fetch data from mongo, fetch single product). I would like to send price data from single product page to server. When I submit form, I…
Peret
  • 79
  • 8
0
votes
0 answers

Heroku Backend/Server uses URL twice

We have some issues on our MERN-App while we want to built our Website on Heroku. In the past it worked very well but after a change of my hard disk I've downloaded the git again but now heroku can't find the path of my index file. We think that the…
HappyGilmore
  • 41
  • 1
  • 6
0
votes
0 answers

fetched data is not rendered by react

My super-simple application fails to fetch and display data. help me to solve the problem , please, I'm stuck. my api seems to be basically working, but it fails somewhere on the way to client. hope, the code snippets I attach will be…
Toto
  • 13
  • 3
0
votes
0 answers

MERN deploy script bundles on render

All my code compiles into dist folder. Client by CopyWebpackPlugin, server by tsc. and it looks like this. HTML sends app.get("*", (req, res) => { res.sendFile(path.join(__dirname, "client", "public", "index.html")); }); For static files i tried…
0
votes
1 answer

how to use nodejs to filter data from mongoDB to only give you data for specific IDs?

My question is easy enough. i just cant come up with the logic myself. I created an api for a social media website using MERN stack. I added a 'get timeline' route that returns all the posts of the people that the current user has friended in…
gerard
  • 221
  • 1
  • 2
  • 10
0
votes
0 answers

Cant get JSON file in postman response in GET and POST requests

I am trying to make a MERN application project and I have make a server with node and express, I made API and i am testing it in postman. The api is working fine with mongodb when i post something but when i request GET it is not showing me or…
0
votes
0 answers

localStorage persist data in react MERN Stack App

I am building a full-stack React App with mongodb and I am trying to persist user data when I log in using localStorage. However, the localStorage is only storing the null value. I have failed to figure out what I am doing wrong, a little would be…
0
votes
0 answers

I'm getting a unauthorised message when i try to login at the client side

I'm working on a Auth with MERN , at the client side i'm using contextAPI ,useReducerhook to manage the user. I have also created a custom hook ( useLogin ) for handling the login criteria as shown below .It takes the userCredentials whoch is a…
0
votes
0 answers

Getting Axios error in my code...can anyone help me to solve this error

POST http://localhost:5000/user/signup 500 (Internal Server Error) AxiosError {message: 'Request failed with status code 500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE', config: {…}, request: XMLHttpRequest, …}code: "ERR_BAD_RESPONSE"config:…
0
votes
1 answer

How can I count all category under productId?

So I'm still new using MongoDB, so what I'm trying to do here is count all category under productId who have same category. So the expected output should be 7. I used populate first but got stuck on how can I use the $count. Instead I use aggregate…
Zurcemozz
  • 183
  • 1
  • 9
0
votes
1 answer

Warning: Cannot update a component (`SearchBar`) while rendering a different component (`RenderSortByOptions`)

SearchBar.js import React, { useState } from "react"; import "./SearchBar.css"; export default function SearchBar(props) { const [term, setTerm] = useState(""); const [location, setLocation] = useState(""); const [sortBy, setSortBy] =…
0
votes
1 answer

ERROR node:internal/errors:491 ErrorCaptureStackTrace(err); in NODEMON SERVER command

I am new learning server side of MERN stack and I can't find any answer of this problem can anyone help me to this error? I already did try all possible solution but it still won't work HELP! node:internal/errors:491 …
0
votes
0 answers

How do I integrate the BTCpay server api to my MERN app

I am creating an app that requires users to sign up, link their wallet and then be able to make crypto transactions between them and another user. I am using BTCpay for this but am unsure on how to link the api to my MERN app and how to allow users…