무료
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
접속관련해서 문의가 있습니다
안녕하십니까? 열심히 따라하면서 결국 완강하게 되었습니다. 감사합니다. 그런데 다음강의(영화api사이트)를 보고서 기본 설정후 npm run dev를 실행하였더니, 하단의 에러가 나고, '노드리액트기본편'도 동일한 메세지가 뜨고 있습니다. 로그아웃버튼 누르면 실패 메세지가 나오고 화면의 움직임이 없는 상태입니다. 어떻게 해결해야 할까요? 부탁드립니다 ㅠ 「wds」: Project is running at http://192.168.10.106/ [1] ℹ 「wds」: webpack output is served from [1] ℹ 「wds」: Content not from webpack is served from /Users/폴더이름/Downloads/boiler-plate-ko-master/client/public [1] ℹ 「wds」: 404s will fallback to / [1] Starting the development server... [1] [1] Compiled with warnings. [1] [1] ./src/_reducers/user_reducer.js [1] Line 11:13: Unreachable code no-unreachable [1] Line 14:13: Unreachable code no-unreachable [1] Line 17:13: Unreachable code no-unreachable [1] [1] ./src/hoc/auth.js [1] Line 2:8: 'Axios' is defined but never used no-unused-vars [1] Line 38:12: React Hook useEffect has missing dependencies: 'dispatch' and 'props.history'. Either include them or remove the dependency array react-hooks/exhaustive-deps [1] [1] ./src/components/views/LoginPage/LoginPage.js [1] Line 2:8: 'Axios' is defined but never used no-unused-vars [1] [1] ./src/components/views/RegisterPage/RegisterPage.js [1] Line 4:8: 'Axios' is defined but never used no-unused-vars [1] [1] ./src/App.js [1] Line 6:3: 'Link' is defined but never used no-unused-vars [1] [1] Search for the keywords to learn more about each warning. [1] To ignore, add // eslint-disable-next-line to the line before. [1]
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
dbname 문제인거 같아요
mongodb+srv://react12:<password>@cluster0-u7pdb.mongodb.net/<dbname>?retryWrites=true&w=majority 이렇게 뜨는데 dbname은 어떻게 해결해야 하나요 ???
- 해결됨따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
mongoURI 관련 질문
mongoose.connect(config.mongoURI, ... 위의 코드에서 mongoURI 라고 실습해주신대로 했을 때 MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string. 위와 같은 오류가 발생해서 한참 삽질을 했는데요ㅠㅠ 혹시나 하고 mongoURL로 고쳐서 런 시켰더니 잘 동작하네요... URI로 사용하면 동작하지 않는 이유가 무엇인가요 원래 동작해야 맞는건가요? 물론 prod.js dev.js도 위와 동일하게 변경했습니다!
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
req is not defined.
수업 정말 잘 듣고 있습니다 :) 양질의 강의 감사드려요. 질문게시판에 있는 거도 다 참고했는데 Postman에 넣어보니 { "success": false, "err": {} } err의 빈칸이 안없어지네요 ㅠㅠ Users.js 코드를 첨부합니다. + console.log("req.body:", req.body)을 해보니 ReferenceError: req is not defined 이렇게 뜨네요. req 정의가 안 됐다고하여, index.js코드도 첨부합니다. const express = require('express') const app = express() const port = 1004 const bodyParser = require('body-parser'); const config = require('./config/key'); const { User } = require("./models/Users"); //application/x-www-form-urlencoded app.use(bodyParser.urlencoded({extended: true})); //application/json app.use(bodyParser.json()); const mongoose = require('mongoose') mongoose.connect(config.mongoURI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false }).then(()=>console.log('MongoDB connected...')).catch(err => console.log(err)) app.get('/', (req, res) => res.send('Hello World! nodemon을 적용해써요><')) app.post('/register', (req, res) => { //회원가입할 때 필요한 정보들을 client에서 가져오면 //그것들을 데이터 베이스에 넣어준다. const user = new User(req.body) //bodyparser가 있기에 가능한 것. //bcrypt로 암호화하기 user.save((err,userInfo)=> { if (err) return res.json({success: false, err}) return res.status(200).json({ success: true }) }) }) //save는 몽고DB에서 온 method app.listen(port, () => console.log('Example app listening on port ${port}!')) //0710: req가 정의가 안됐대 //console.log("req.body:", req.body) -------------------------------------------- const mongoose = require('mongoose'); const bcrypt = require('bcrypt'); const saltRounds = 10 const userSchema = mongoose.Schema({ name: { type: String, maxlength: 50 }, email: { type: String, trim: true, unique: 1 }, password: { type: String, maxlength: 50 }, role: { type: Number, default: 0 }, image: String, token: { type: String }, tokenExp: { type: Number } }) userSchema.pre('save', function( next ){ var user = this; //비밀번호를 암호화 시킨다. if(user.insModified('password')) { bcrypt.genSalt(saltRounds, function(err, salt) { if(err) return next(err) bcrypt.hash(user.password, salt, function(err, hash) { if (err) return next(err) user.password = hash next() }) }) } else{ next() } }) // mongoose에서 가져온거, 저장하기 전에 적용할 함수 const User = mongoose.model('User', userSchema) module.exports = { User }
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
onSubmit 핸들러
바닐라 자바스크립에서는 button이나 form한쪽에만 submit을 줘도 동작하는 걸로 알고 있었는데, 리액트는 form과 그 안에 있는 button 양쪽에 submit을 줘야만 submit이 실행되는 건가요? 그렇다면 이건 리액트를 만들 때 정해놓은 규칙인것인가요?
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
클라우드에서 디비어떻게봐요?
선생님처럼 보고싶은대 어디서 보는지 모르겟습니다 ㅠㅠㅠ
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
MongooseServerSelectionError: bad auth Authentication failed.
MongooseServerSelectionError: bad auth Authentication failed. 안녕하세요, 에러 구글링해가면서 잘 헤쳐나가고 있는데 이 에러는 해결 방법을 모르겠습니다.
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
로그아웃할 때 포스트맨이 sending request에서 멈춰버립니다..
코드는 이렇게 입력했고 로그인 까지는 잘 되는데 로그아웃이 되질 않습니다 ㅜㅜ 포스트맨에서 email password 똑같이 넣고 get으로 요청 보냈습니다
- 따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
redux devTool에서 state에 로그인확인 내용이 나오지 않습니다.
삭제된 글입니다
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
세미콜론(;) 쓰는것은 뭐고 아닌것은 무엇인가요
궁급합니다
- 해결됨따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
12강 에러 질문드립니다..
register 부분까지는 정상적으로 진행했고, login 부분으로 넘어왔는데 ReferenceError : user is not defined at c:...생략...\boiler-plate\index.js:51:5... 이런 오류가 뜹니다.. 강의자님의 github나 다른 질문들을 훑어봤지만 강의 내용과 코드의 다른점을 찾지 못했습니다.. 도와주세요..! https://github.com/coffeescriptSERRL/study-boiler-plate-ko/blob/master/index.js
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
선생님 질문이 있습니다
저번 강의에서는 postman 에서 raw 타입으로 데이터를 보냈을 때 true가 떠서 아무 문제가 없었는데 데이터베이스에는 빈 객체가 들어갔더군요. 오늘도 raw 타입으로 보내는데 계속 false가 뜨고 이유를 확인해보니까 email이 null이라고해서 req.body를 찍어보니까 빈 객체로 나오더라고요 ㅜㅜ 그래서 postman에서 raw타입 말고 x-www-form-url-encoded로 보내니까 req.body에도 데이터가 잘 찍히고 몽고디비에도 데이터가 정상적으로 잘 들어갔네요 . password도 brypt로 암호화되서요. 왜 raw타입으로 보내면 저런 현상이 발생하는 걸까요? 저희가 index.js에 app.use(bodyParser.urlencoded({ extended: true })); 를 해준것과 관련이 있는걸까요?
- 따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
Warning: The tag <lable> is unrecognized in this browser.
삭제된 글입니다
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
선생님 도와주세요 ㅠ
key.js dev.js prod.js 다 만들고나서 이제 index.js에도 불러오고나서 npm run start를 하면 이런 오류가 나옵니다 ㅠㅠ이거때문에 다음 진도를 못나가고 있어요 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! boiler-plate@1.0.0 start: `node index.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the boiler-plate@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\낙꼬\AppData\Roaming\npm-cache\_logs\2020-07-07T19_38_53_676Z-debug.log
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
proxy 테스트하는데 4o4 오류가 뜹니다
npm run dev 로 돌리고 http://localhost:5000/api 로 접속하면 아래와 같은 오류가 발생합니다 ㅜ GET http://localhost:5000/api 404 (Not Found)
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
화면(=크롬 개발자도구console에) 아래와 같은 오류가 발생하는데ㅠㅠ....
화면에(=크롬 개발자도구 Console에) "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers." 라는 오류가 찍히는데ㅠㅠ...구글링해봐도 무슨말인지 이해가 잘 되지 않습니다ㅠㅠ....
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
저는 엔터만 눌렀는데 이렇게 뜨는데 왜그런거죠?ㅠㅠ
(사진)
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
Page Component들의 render() 에 대하여
안녕하세요! 먼저 좋은 강좌 너무나도 감사드립니다. 급하게 리엑트를 공부하느라 러닝커브에 정신못차리고 있었는데 그나마 이렇게 좋은 강의 남겨주셔서 실낱같은 희망을 안게되었습니다. 강의 듣던중 2강좌를 남겨둔 이 시점에 문득 생각난 질문이 있어 이렇게 질문올립니다. 리엑트는 기본적으로 Component에서 render() {}를통해 화면을 그리는 처리를 넣어서 가상DOM에 state가 변할때 마다 다시 그리는 처리를 한다고 이해하고 넘어왓었는데, 지금보니 오직 index.js에만 render가 있더라구요. 그렇다면, 각 콤포넌트에 render를 다는 것이 필수가 아니라 index.js에만 render를 처리하고 나머지 콤포넌트들은 Switch를 통해 SPA 를 실현하고 라우팅 될때마다 return을 통해 DOM 오브젝트들을 리턴한다고 이해해도 괜찮을까요? 아니면 REDUX를 함께 쓰는 특수한 상황에 의한 것으로 state는 오직 중앙에 있는 Redux를 통해서만 관리하기 때문에 Redux를 연동하는 처리를 넣어준 index.js에서만 render를 해서(해줘야) state의 변화를 감지하고 render에서 state가 바뀔때마다 다시 그리는 처리가 실행된다고 이해하는 것이 옳을까요? <강의중 index.js의 코드> ReactDOM.render( <React.StrictMode> <Provider store={createStoreWithMiddleware(Reducer, window.__REDUX_DEVTOOLS_EXTENSION__&& window.__REDUX_DEVTOOLS_EXTENSION__() )} > <App /> </Provider> </React.StrictMode>, document.getElementById('root') );
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
proxy 연결오류
선생님 안녕하세요! 제가 현재 proxy강의를 듣고 실습을 따라해보고 있는 중에 에러가 나서 /api/hello를 받아올수 없습니다.. 위의 오류가 뜨는데 서버연결이 안되는 오류 인것같은데 이 전 강의로 해서 postman으로 보내고 할 때까지만 해도 잘 전달이되었습니다..! 서버 포트도 5000으로 잘 되어있구요 서버의 index.js에서 app.get('/api/hello', (req,res)=> res.send("proxy!!")) 이렇게 작성해주었고요.. 서버는 npm run dev하면 5000번 포트로 연결되었다는 문구와 몽고db연결되었다는 구문이 같이 뜹니다!! 어떻게 하면 해결이 될까요? 배우기 쉽게 항상 강의해 주셔서 감사합니다!
- 미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
12강 무한로그인 되시는분들을 위한글
저도 검색하고찾았네요! 영상속에 오타인지 userSchema.methods.comparePassword = function (plainPassword, cb) { //plainPassword 1234567 암호화된 비밀번호 <?????> bcrypt.compare(plainPassword, this.password, function (err, isMatch) { if (err) return cb(err); cb(null, isMatch); }); }; if (err) return cb(err); <-이 부분이 영상에선 , 로 되어있습니다. cb(null, isMatch);