Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
7
votes
4 answers

Best way to store images in MERN stack web application

I am building a web application using the MERN stack (MongoDB, Express Server, ReactJS front end and NodeJS back end) and was wondering some good ways to store images from the back end. In the past, I have used Firebase for authentication and…
Croc
  • 789
  • 7
  • 13
7
votes
2 answers

Put works in Postman but not AXIOS

This is the weirdest thing in my MERN app. When I do a PUT from Postman to my api it works and updates my api and mongoDB. On the front-end it doesn't update the api even though console logs are showing the correct values and the url is the same?…
angelHank
  • 109
  • 1
  • 2
  • 8
6
votes
1 answer

Warning: No available formula with the name "mongodb-community@6.0"

Trying to install mongodb server on my mac using Brew but getting this error. Updated my brew to latest version, still egtting this error. Command i used: brew install mongodb-community@6.0
Zohaib Amir
  • 221
  • 2
  • 8
6
votes
1 answer

MUI Drawer opening but not closing in React web app

I have a Navbar component in my React app which shows a Sidebar component when screen is small. I used Material UI for the Drawer for displaying the sidebar. My issue is, on clicking the hamburger icon, drawer opens fine. But it doesn't close when…
user19367608
6
votes
3 answers

How to hide a sidebar from a login page in react router

I'm trying to hide a sidebar component from showing when a user visits the signup or login page. In react-router-dom version 5, we could use a div tag inside the Switch but it has been replaced with the Route element and it throws an error when a…
0x307
  • 67
  • 1
  • 5
6
votes
5 answers

How to convert 2021-07-14T00:00:00.000Z into a standard date in YYYY-MM-DD format

Can someone please explain how to convert this 2021-07-14T00:00:00.000Z date string value into the YYYY-MM-DD format in react.js (javascript)
6
votes
5 answers

How do I enable pop-up menus from materialise in React?

I have a React app, I'm trying to add a NavBar there like this
user15591520
6
votes
3 answers

Why useState hook don't update while using loop inside useEffect()

Case 1: const [present, setPresent] = useState([]); useEffect(() => { for (var j = 1; j <= totalPeriod; j++) { setPresent([ ...present, { period: j, present:…
6
votes
2 answers

Best practices for setting up a MERN application on AWS

I know this is subjective and opinionated, but I just need something to start off from knowing what the best practices may be. I've got a MERN application running on localhost with the React script currently running on port 3000 and an Express.js…
totalnoob
  • 2,521
  • 8
  • 35
  • 69
6
votes
1 answer

Serving REACT component using express is not working (just html file is rendered)

Hello I am learning MERN stack and I have problem with serving my react component this is server.js code const path = require('path') const fs = require('fs') const express = require('express') const app = express() app.set('view engine',…
Rachomir
  • 280
  • 1
  • 5
  • 16
5
votes
0 answers

@react-pdf-viewer/core ERROR: pdfjs-dist/build/pdf.js: Unexpected character '#' (1413:9)

I am trying to implement pdf viewer using this react-pdf-viewer. But, it keeps throwing this error: /node_modules/pdfjs-dist/build/pdf.js: Unexpected character '#' (1413:9) 1411 | 1412 | class PDFDocumentLoadingTask { 1413 | static #docId =…
AG_HIHI
  • 1,705
  • 5
  • 27
  • 69
5
votes
3 answers

what is 'npm un dev' as i accidently run in my terminal?

I accidently run a command in my Mern project that ' npm un dev' instead of 'npm run dev' and it delete some packages and i don't know how to recover these packages.
Talha Khan
  • 53
  • 4
5
votes
1 answer

How to call navigate inside Redux Toolkit's actions in React js

I've a simple app built on redux-toolkit. I am dispatching createProduct actions which is working fine. I want to navigate to /products/ page form /products/new page after createProduct action. How can I use navigate (react-router-dom) to do this. I…
UAhmadSoft
  • 97
  • 1
  • 9
5
votes
1 answer

Heroku[router]: at=error code=H10 desc=”App crashed“ method=GET path=/favicon.ico”

I have a simple MERN APP, that works fine on localhost, but when I deploy it to Heroku I see a page with this error: Application error An error occurred in the application and your page could not be served. If you are the application owner, check…
Sauvik Sood
  • 63
  • 1
  • 4
5
votes
3 answers

How to retrieve the last added record from the database in the MERN technology stack?

I am creating an apllication using the technology stack MERN and Redux. I am wondering how to retrieve the last added record to the database using moongose. Assume it will be, for example, a list of orders assigned to a particular user. I already…
nsog8sm43x
  • 329
  • 5
  • 14