Giter Club home page Giter Club logo

mern-exercise-tracker-mongodb's Introduction

mern-exercise-tracker-mongodb's People

Contributors

beaucarnes avatar cmarchena avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mern-exercise-tracker-mongodb's Issues

Error 404

Cannot fetch from and to server within the react app.
Im getting Unhandled Rejection (Error): Request failed with status code 404

error

typo in src/components/navbar.components.js

collapse is spelled wrongly as collpase.
On further inspection I figure that collapse isn't required either and the correct css will just be
className = "navbar-collapse"

can't connect to mongoDB atlas

hi
thanks a lot for a great tutorial. I am new to nodejs and the whole mern stack.
I have executed the code as instructed but the connection to mongoDB atlas is not working.
The confirmation string about the successful connection is displayed on the console.
also the mongoDb cluster dashboard does not show any connections

server.js connection

It does work but sometimes when server starts/restarts I get that error and get disconnected to db

[nodemon] starting `node server.js`
Server is running on port: 5000
(node:18433) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 0 to crud-shard-00-02-2su4c.gcp.mongodb.net:27017 closed
    at TLSSocket.<anonymous> (/home/root/Documents/crud/crud-test/backend/node_modules/mongodb/lib/core/connection/connection.js:352:9)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:198:13)
    at _handle.close (net.js:606:12)
    at TCP.done (_tls_wrap.js:388:7)
(node:18433) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18433) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I also passed this option { useUnifiedTopology: true } to the MongoClient constructor, but still even without that I still get that error.

Not able to re-run the application

After coding the first time, I was able to run the application and connect to database properly. However, after a week when I tried to start the serve (nodemon serve & npm start), I don't see the database connected or any sucessfull port connection. The UI is visible but trying to add users gives this issue:

[Error] Could not connect to the server.
[Error] XMLHttpRequest cannot load http://localhost:5000/users/add due to access control checks.
[Error] Failed to load resource: Could not connect to the server. (add, line 0)
[Error] Unhandled Promise Rejection: Error: Network Error
	(anonymous function) (0.chunk.js:954)
	promiseReactionJob

Same with adding exercise. No users visible. MongoDB shows that the relevant databases and records.

Any idea, what needs to be done while restarting the application on localhost?

TypeError: Cannot read property 'value' of undefined

Hello..
Please .....help . There's a error in "Create New Exercise Log" (create-exercise.component.js) while entering data in "description" field.

The error which comes is -

TypeError: Cannot read property 'value' of undefined
CreateExercise.onChangeDescription
src/components/create-exercise.component.js:42
39 | // console.log(e);
40 | // console.log("sdfsdf");
41 | this.setState({

42 | description: e.targer.value
| ^ 43 | })
44 | }
45 |

throw new TypeError('Router.use() requires a middleware function')

something wrong with the use of router if you understand i need fast response
[nodemon] starting node server.js
D:\Program Files\Mern\exercise-tracker\backend\node_modules\express\lib\router\index.js:462
throw new TypeError('Router.use() requires a middleware function')
^

TypeError: Router.use() requires a middleware function
at Function.use (D:\Program Files\Mern\exercise-tracker\backend\node_modules\express\lib\router\index.js:462:11)
at Object. (D:\Program Files\Mern\exercise-tracker\backend\routes\users.js:4:8)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (D:\Program Files\Mern\exercise-tracker\backend\server.js:21:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)

Node.js v20.11.0
[nodemon] app crashed - waiting for file changes before starting...

Router issues

I am pretty new to FullStack and love your videos as they are excellent. Again thanks a lot for making the videos and it is so helpful. One of the issue I am facing is the below line of code is, I am not sure what I am missing. Appreciate your help.
//app.use("/exercises", exercisesRouter);
//app.use("/users", usersRouter);

D:\FullStack\Projects\ExcerciseTracker\node_modules\express\lib\router\index.js:458
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^
TypeError: Router.use() requires a middleware function but got a Object
at Function.use (D:\FullStack\Projects\ExcerciseTracker\node_modules\express\lib\router\index.js:458:13)
at Function. (D:\FullStack\Projects\ExcerciseTracker\node_modules\express\lib\application.js:220:21)
at Array.forEach ()

License

This repo has no license. If possible, I would suggest the addition of the MIT license.

'react-scripts' is not recognized as an internal or external command, operable program or batch file.

I am creating a MERN Stack App and when I run nodemon server, i get this error
C:\Users\utkarsh\chaiDB\mern-chaicoffeebiscuit>nodemon server [nodemon] 2.0.2 [nodemon] to restart at any time, enter rs[nodemon] watching dir(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] startingreact-scripts start server 'react-scripts' is not recognized as an internal or external command, operable program or batch file. [nodemon] app crashed - waiting for file changes before starting...

It worked succesfully until i started to work on the frontend using reactJS.
Now I have the full app completed. but the mongoDB server does not run now.
I have already tried commands like npm install react-scripts --save but still, i see the same error. I even reinstalled my Windows 8.1 (i loved the project by my heart and wanted to complete it)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.