Questions tagged [mern]
MERN stands for Mongo, Express, React and NodeJS.
2,465
questions
0
votes
0
answers
10
views
Trouble in editing an open source project. MERN E-Commerce app
I have cloned one open source mern stack ecommerce application. But I can't edit anything in client side.Even I have deleted client folder completely. But still executing the UI completely . I don't ...
1
vote
1
answer
24
views
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@designed-and-developed%2feslint-config-prettier-typescript-react - Not found
I cloned a fullstack MERN (Typescript) project from github and when i was checking out the code on VS code i noticed there were errors everywhere for packeges as of they weren't installed and when i ...
0
votes
1
answer
20
views
why CSRF token always say invalid CSRF while I send the token through request to the backend?
i import these two packages (csrf, cookieparser) and using inside the appjs for express only its working and also i tested in postman it's working fine here is my code express js:
const csrf = require(...
0
votes
0
answers
18
views
mongoose find multiple filters not working
Good day guys, I am trying to set up a store filtering API with node and MongoDB in the format below.
getProduct = async (req, res) => {
try {
const {
name,
category,
brand,
...
0
votes
0
answers
22
views
React render function not returning the simple HTML codes from it's components
I am creating a project using MERN stack.In my App.js I imported some react component but while I run it shows a blank White screen.
App.js
import React from "react";
import "bootstrap/...
0
votes
0
answers
19
views
I want to get image from backend to frontend in MERN Stack
I want to get image from backend to frontend in MERN Stack. all data gets about product also gets image title but images cannot render.
I want to get image from backend to frontend in MERN Stack. all ...
1
vote
0
answers
38
views
How to resolve: Failed to load resource: the server responded with a status of 404 (Not Found) in Reactjs
I am working on a social interface project with MERN Stack technology on windows 10. I am running my frontend on port 3000 and my backend on port 5000 of my localhost. When I perform an operation that ...
0
votes
1
answer
22
views
Axios Post Request: Output saved in Config Data instead of Data field
I'm following this MERN Stack Tutorial to build a simple app, and running into a frustrating issue.
On the front end (React side), I am making an Axios post request to store student into a student ...
2
votes
0
answers
19
views
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 ...
0
votes
0
answers
11
views
How can I implement fingerprint scanner with MERN stack app?
I want to build a mearn stack web application where I need to read data from an external fingerprint device and store the data into the MongoDB database for future operations.
It might be compared ...
0
votes
2
answers
42
views
Too many re-renderds | React App | State Variables updated in Component Function Not Working
Problem Summary
I am working on a React app with Node.js, Express.js, MogoDB backend.
I have a progress bar component. The number (i.e. percentage) that I pass to the progress bar comes from a ...
-1
votes
0
answers
17
views
How to close the localhost tab after click the quit button in socket.io andd nodejs [duplicate]
I am not able to close the tab using quit button in socket.io chat application as I want to close the current localhost room tab if I click "QUIT" button.
socket.on('leave-room', (...
0
votes
0
answers
9
views
why aggregation gives same results while sorting
this is my code to aggregate
{ $match : { role: true } },
{
$project:{
_id:0,
products:{
$filter:{
...
0
votes
1
answer
24
views
Mongodb Searching in an array of ids using include does not work
I have this model:
const NeighborSchema = new Schema({
friends: [
{
type: Schema.Types.ObjectId,
ref: "users",
},
],
date: {
type: Date,
default: Date.now,
...
-1
votes
0
answers
25
views
how can render the array present in state in html using map function by using function component?
**how can render the array present in state in html using map function by using function component ? **
I am trying to render the table of a given number by user and every thing working but i am ...
-1
votes
1
answer
40
views
Unable to send objects as payload data while making an Fetch API request
I have a react frontend and node backend, I am fetching a list of objects from an external API using Axios and then trying to pass it to my node backend. The issue is that the node backend is not able ...
0
votes
0
answers
26
views
My MERN web app is not connecting in the browser [closed]
I have been trying to learn how to use the MERN stack by creating a simple web app. I even downloaded multiple already completed projects from GitHub and the one problem I keep happening in EVERY ...
0
votes
2
answers
37
views
Modify the objects of an array of objects
I want to modify the objects of an array of objects (jsonStudent).
[
{ Student: 'Riya', Gender: 'Female', Pet: 'Timmy' },
{ Student: 'Happy', Gender: 'Male', Pet: 'Harry' },
{ Student: '...
0
votes
0
answers
22
views
How to make Post request with Axios (MERN Stack)
I am new to REACT and the MERN Stack and try to understand everything. But sometimes, it seems that the simplest things do not want to get into my head.
I hope that, one day, I will understand it all. ...
-1
votes
0
answers
26
views
react proxy not working while posting the data
I am trying to post user details on the express server by using React. I also added a proxy in the package. json file and also install and import the cors on the express server. Everything is OK, but ...
0
votes
2
answers
53
views
How do I pass data to the backend using Reactjs?
The backend is working properly with the Postman. but it not working correctly with my front end. This error occurs when I try to add a product. I used the Axios to send HTTP requests from the ...
1
vote
2
answers
30
views
React acting weird (compiled with problems 9 errors)
I've been working with react using mern stack. Everything was fine until I used JSON.parse in a function when getting data out of the mongo database. I clicked save and I got 9 errors. I removed all ...
0
votes
1
answer
13
views
dotenv not updating on the React frontend with pm2
I have deployed my MERN app on aws ec2 ubuntu and I am using dotenv to load my environment variables, using pm2 for the server and also using nginx.
In the server I am trying to load the values on my ....
0
votes
0
answers
17
views
how to deploy MERN stack application on cPanal?
I made a MERN stack application. It works properly on localhost. Now I want to deploy the application on cPanal of https://stackcp.com. I am unable to deploy my application. It is my first experience ...
-2
votes
0
answers
24
views
How to use django python framework with MERN Stack technology to create a web application?
I'm working on a MERN Stack project. My frontend is designed in reactjs and is connected to a backend using Nodejs, Expressjs, MongoDB. I designed a scraper using bs4 and that was managed by Django, ...
-4
votes
0
answers
15
views
Why is routing handled at both the frontend and the backend in MERN-based applications? [closed]
Why is routing handled at both the frontend and the backend in MERN-based applications? Provide one example to justify your answer.
-1
votes
1
answer
17
views
How to get error message in postman instead of console
I am using node.js. I am getting the errors in the console window but I want it in the postman result.
Following is the code:
try {
const { username, email, password } = req.body;
if (!...
-1
votes
0
answers
13
views
EACCES: permission denied, open '/home/ubuntu/doof-internship/frontend/node_modules/.cache/.eslintcache'
Deployed a MERN-based web application on an EC2 instance(Ubuntu 20.04 LTS) and getting this error while accessing the application.
-2
votes
0
answers
18
views
I am making a web application and I want to write an algorithm. I am using MERN as technology stack [closed]
which framework should I write this algorithm on ?
or do I separately need to write the algorithm on any other framework/language than current MERN stack? if yes, which would be that language.
1
vote
0
answers
15
views
Argument appears to not be a ReactComponent. Keys:
I need to print a component for that i'm using react-to-print package.
here everything is working fine. when i try to customize it based on my requirement
i'm getting this error. i tried to search in ...
0
votes
2
answers
49
views
Uncaught Error: [Topbar] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>
I have looked at the previous questions and googled for the answer and I think I almost know what the issue in here is, but don't know how to solve it.
return (
<Router>
<Routes>
...
-1
votes
0
answers
24
views
Delete image from AWS S3 it returns access Denied
I'm creating node JS Rest API
and try to delete image from my s3 bucket it always return access denied but my API for upload image to s3 is working fine
//the code for delete image
export const ...
0
votes
0
answers
15
views
I am getting a constant sending request in postman
I am doing a post request using postman to my server but instead, I am getting a sending request display on my postman. It is not showing any error and I am pretty new to this technology. Please help.
...
0
votes
0
answers
17
views
nodejs server not sending headers to react fronted [closed]
I have developed a MERN app and hosted frontend on vercel and backend on heroku.
everything works fine on my laptop but when i access the site using my phone or someone else`s laptop every api works ...
0
votes
0
answers
35
views
what is the best way to use sockets with database entries in another file?
I have used socket in another file, not in server.js/index.js
socket.js
const io = require('socket.io')()
io.on('connection' , (socket)=>{
console.log('We are getting a NEW Connected');
socket....
0
votes
1
answer
26
views
Project with Node Server + React UI (Typescript) heroku only displaying node backend
I created a Github project with combined server (Node.js) and UI (React) for a simple web app trying to learn the MERN stack. The app builds fine and Heroku brings up the "Up" state as well. ...
0
votes
0
answers
9
views
Face problem when deploying mern application to heroku
I face problem when I opened the app deployed on heroku
2022-06-25T03:52:33.123405+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-06-25T03:52:33.123406+00:00 app[...
1
vote
2
answers
18
views
Best approach to display updated list in React via fetch again or through some other way
After any action (add or update or delete) on list displayed in react UI, what should be the best approach to display updated list in react.
Fetch the list again from database
Since we are modifying ...
0
votes
0
answers
16
views
Session data still not persistent between routes, even though session management is done via connect-mongo in MongoDB
Even though I let MongoStore handle my sessions, my sessions are still undefined when I try to access sessions from a different api route.
For example in my /login route:
app.route("/login")
...
1
vote
0
answers
32
views
Online compiler in nodejs [closed]
I am making an online ide using node.js and child processes to interact with the terminal. But I am not able to handle the case where the client submits a code with dead end for eg a code likewhile(...
1
vote
1
answer
28
views
Type 'Error' is not assignable to type 'ReactNode'
I am getting the error when i am passing the error to the message component.
Type 'Error' is not assignable to type 'ReactNode'.ts(2322)
Message.tsx(6, 3): The expected type comes from property '...
-1
votes
0
answers
19
views
REACTJS -- setting inline style on mouseover and mouse out
as u can see on the image , I am changing the background color of the button using useState() , and it is not working , for me its like all code was correct , can anyone help me in this ?
0
votes
1
answer
29
views
Cast to ObjectId failed for value \"\" (type string) at path \"category\" because of \"BSONTypeError\
I have the Cast to error in JSON response when Adding the Product Details in the & when adding category showing Error.
const mongoose = require("mongoose");
const { ObjectId } = mongoose....
-4
votes
0
answers
17
views
Polling in online compiler [closed]
I am making an online compiler using Node.js(MERN) and child processes but I came across a video where it was mentioned that we need to do "polling" in order to do that as making long ...
0
votes
1
answer
18
views
How to show a specific page in MERN only when user has logged in
What I want is to show about us page with users info upon logging in else redirect the user to login page.Now when i try to visit about us page without login in, I am sent to login page, But even ...
-1
votes
0
answers
16
views
Unable to save the returned value a function in javascript [duplicate]
function getFieldsforRandomisation(){
let model = [];
const proj = { updated_at: 1, created_at:1 };
NewArrival.find({},proj).exec((err, objects) => {
if (err) {
console.log(err);
...
0
votes
0
answers
10
views
User sessions data does not persist when calling from a different route
My user session does not persist within the server. I can see within the log that I saved it in my /login route, but when I try to access it from a different route, its "undefined".
My /...
0
votes
0
answers
21
views
The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is include
I have been trying to make a MERN stack project,and I was learning about sockets,but I am encountering this error when I try to use sockets:
Access to XMLHttpRequest at 'http://localhost:5000/socket....
0
votes
1
answer
42
views
Redux toolkit. Uncaught Error: uSES not initialized
I'm learning about the react-redux toolkit and here is some problem I'm facing I just simply want to increment and decrement numbers by clicking on buttons.
File no.1(counterReducer.js)
import {...
0
votes
0
answers
13
views
Trouble deploying MERN Application to Heroku
Tried a bunch of reformats on my server.js file. config is put into heroku settings.
Error: Cannot read properties of null (reading 'split')
is what seems to be standing out to me in the logs. Along ...