Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
5
votes
1 answer

Unable to access my website using the IP address of my Digital Ocean droplet

I am in the process of deploying my MERN app to a Digital Ocean droplet(Ubuntu 20.04 server). I have cloned my GitHub repo, installed the dependencies and pm2. I start the server using the command pm2 start server/index.js. Then when I visit the…
HKS
  • 526
  • 8
  • 32
5
votes
6 answers

mongoDB whitelist IP

I am seeing similar posts, however none are helping me solve my problem. Following a Udemy tutorial that builds a MERN application from scratch, I got stuck on the mongoose connection. Here is my index.js code: const express =…
John Beasley
  • 2,577
  • 9
  • 43
  • 89
5
votes
8 answers

GET http://localhost:5000/posts net::ERR_CONNECTION_REFUSED

I'm trying to make a project using the MERN stack and I encountered this error. I already added the proxy do the JSON file but still no luck. the error: GET http://localhost:5000/posts net::ERR_CONNECTION_REFUSED my actions: export const getPosts =…
Henrique Guimarães
  • 203
  • 1
  • 3
  • 17
5
votes
1 answer

Not able to connect by frontend to backend on heroku after successful deployment

I have deployed my mern stack app on heroku. The problem is i am not able to make any request to my backend . I am connecting my frontend to my backend like this... API=http://localhost:5000/api import { API } from "../../backend"; import {…
atharv joshi
  • 71
  • 1
  • 4
5
votes
0 answers

invoke lambda function from lambda function is misbehaving

Issues occuring: While system try to invoke child function from parent function, it skip(do not invoke) function and also do not gives any response or error If child function invoked by parent successfully then it wan't get/fetch the data with help…
5
votes
5 answers

path "/tmp/build_.../client/package.json" no such file or directory

I had tried to deploy a MERN stack application on heroku. I had followed the procedure given in the heroku documentation. But, somehow I am unable to deploy the application to heroku. The following is my server.js code: const express =…
Y SAHITH
  • 160
  • 2
  • 13
5
votes
3 answers

React Redux folder structure for Fronted and Dashboard

I am using MERN stack to develop an application. The front end (React + Redux) is totally isolated from backend(express + mongo). I am using CORS, JWT and all good things to connect both of them. The front-end itself has an user view and dashboard…
logesh
  • 303
  • 2
  • 8
5
votes
1 answer

Using mern.io scaffolder tool - What is the .need method all about?

Based on the scaffolder mern.io I was going through the code to see what was going on. I stumbled upon a .need method which looks like something related to es6 classes. I can't seem to find any usable info anywhere, so I ask what is the .need…
Sten Muchow
  • 6,623
  • 4
  • 36
  • 46
4
votes
1 answer

How to fulfill orders after Stripe's checkout.session.completed event?

My problem is with Stripe's metadata object having a 500 character limit. I have a working checkout flow but my only restriction is the character limit for my cart. My cartItems object has extras and customer notes I want to include for each cart…
noobror
  • 43
  • 4
4
votes
2 answers

SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js:723:23)

What might be causing the error ``` /usr/local/lib/node_modules/serve/build/main.js:4 import { cwd as getPwd, exit, env as env2, stdout } from "node:process"; ^ /usr/local/lib/node_modules/serve/build/main.js:4 import { cwd as getPwd, exit, env as…
Viral Jain
  • 41
  • 1
  • 2
4
votes
2 answers

The useEffect hook is loading the data two time, I mean it is running twice

I am trying to load data to my App.js file in react from the backend. I have used redux to build the whole data fetching and storing pipeline from backend to frontend. Here is the code : function App() { const dispatch = useDispatch(); …
4
votes
1 answer

How to handle redirect from identity provider in OpenID Connect flow in SPA without losing state

I'm trying to implement social login functionality in a MERN SPA so that users can login to my site using their Google/Facebook/Twitter/etc. login. This is clearly a very common scenario, and there are tons of posts and examples that address how to…
4
votes
2 answers

Not able to fetch Image

I am trying to get image but i am getting error: Failed to load resource: the server responded with a status of 404 (Not Found) TopBar.jsx import { useContext } from "react"; import { Link } from "react-router-dom"; import { Context } from…
Karan Sharma
  • 136
  • 3
  • 13
4
votes
1 answer

Proxying api requests in production for React/Express app

I'm working on a MERN-stack project using separated repositories (backend & frontend), In development environment, I was using "proxy" to connect the server API with react, and it was working perfectly. //package.json in react { ... "proxy":…
Hessah
  • 192
  • 3
  • 12
4
votes
5 answers

Can you tell me if express-mongo-sanitize is working?

I'm trying to set up some security middleware for my humble little MERN web app, and I'm currently using helmet and express-mongo-sanitize, specifically for protection against NoSQL injection attacks. I've set it up, however, as below in my…
Bugwhacker
  • 51
  • 1
  • 4