Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
0
votes
0 answers

Stripe popup not opening on mobile

I have a website on MERN STACK in which I have Stripe implemented, the problem is when I try to pay through Stripe on a desktop/PC it works fine but when I try the same thing on a browser using mobile it redirects me to Stripe website and says an…
0
votes
1 answer

Creating admin user in MERN

I want to create an admin user in my MERN application, I created a user model on back-end and put isAdmin there. Now I want to protect some routes on back-end. On front-end I need to protect normal user to access admin panel, which is accessible…
Dzen00
  • 1
  • 1
0
votes
1 answer

Vercel and Railway deploy

im trying to deploy a simple MERN app with a Vercel front end and Railway back end, working perfectlly in localhost, so far the backend part seems ok, it works as expected with MongoDB and Postman. The problem im facing is that whenever I make a…
Ema Rose
  • 1
  • 1
0
votes
1 answer

Images not showing in pug template

I have put the images folder inside the views folder and added the relative path to the images but the images are not loading on the html page. I have tried multiple options like putting the folder outside views, giving absolute path but nothing…
0
votes
1 answer

How can I get the totalPrice of product inside a nested document?

How can I get the total price of specific item, I'm trying to multiply the quantity and the price and then POST it, but I'm having a hard time on how can I save the total amount of specific item OrderSchema.js const OrderSchema = new…
Zurcemozz
  • 183
  • 1
  • 9
0
votes
0 answers

Cannot find module './routes/Auth' Require stack: - C:\Users\me\Desktop\E-commerce_Web\backendnode\index.js

I am doing a mern project but at begin I got an error . const express=require("express"); const mongoose= require("mongoose"); const app=express(); const dotenv=require("dotenv") dotenv.config() //connect router const…
Suvam Ray
  • 11
  • 2
  • 4
0
votes
0 answers

Getting Axios Error when trying to setup authentication (MERN)

Error Message AxiosError {message: 'Request failed with status code 500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE', config: {…}, request: XMLHttpRequest, …} code : "ERR_BAD_RESPONSE" config : {transitional: {…}, adapter: Array(2),…
0
votes
0 answers

const err = new MongooseError(message);

i was making an api but i got here an error the error: const err = new MongooseError(message); full error: MongooseError: Operation `users.insertOne()` buffering timed out after 10000ms at Timeout.
0
votes
1 answer

How can I easily use query-string or any other alternatives in commonJS module

I'm new to MERN development. I'm trying to build a learning management system by following an old tutorial. But I ended up getting this error: C:\Users\MRPla\Downloads\CourseGuccho\edemy\server\controllers\instructor.js:1 Error [ERR_REQUIRE_ESM]:…
0
votes
0 answers

Why when I send the data through a normal JSON text (Thunder Client) it works, but if I use forms (Thunder Client) It doesn't?

I've tried it with Postman too and it does the same thing. I was following a tutorial and ran into this problem, which the creator didn't have. I copied and pasted (After error) his same working folder and the same thing: It works with JSON: But it…
Gorgi-San
  • 9
  • 2
0
votes
1 answer

Why axios onUploadProgress is not working in React JS App

I have added one feature around 1 month ago, which show progress of uploading file that time axios onUploadProgress is totally working fine, but now its not even get called when I am uploading file code: …
0
votes
0 answers

Create a post with image file and json data - MERN stack, cloudinary, multer

I am trying to create MERN stack app with the function creating job posts with json data (company name, position etc) and the image (company logo). I use multer and cloudinary to upload and save image, and mongo db to save file path. I cannot send…
Yuko
  • 31
  • 8
0
votes
2 answers

ErrorCaptureStackTrace(err); ^ Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

const seedRouter = express.Router(); seedRouter.get('/', async (req, res) => { await Product.remove({}); const createdProducts = await Product.insertMany(Data.products); res.send({ createdProducts }); await User.remove({}); const…
Laxman
  • 15
  • 4
0
votes
1 answer

How to add multiple sub fields for main field in mongodb using mongoose

I want to modify Mongoose schema for order management system. How to update my schema which can be make possible to order multiple foods for same customer(from one post request). ex - customer1 wants to order - 2 Fried-rice and 1 pizza` `const…
0
votes
0 answers

Chrome Browser with localhost

Testing an e-commerce website, it's MERN stack when I run npm run develop chrome opens the page on localhost but I'm unable to click anything on it. I open Microsoft Edge go in the localhost the application works properly, can add to cart, go into…
1 2 3
99
100