안녕하세요 선생님 양질의 강의 제공해주셔서 감사히 잘 듣고 있습니다! 9강 수강중 아래와 같은 에러가 발생해 문의드립니다. 구글링해 해결하려해도 잘 되지 않네요 ㅜ error: src refspec master does not match any error: failed to push some refs to '~~.git' 이 에러를 해결하려면 어떻게 해야할까요? 답변 주시면 감사하겠습니다.
안녕하세요 front에서 내용을 수정하고 ec2에서 git pull하고 npm run build과정에서 자꾸 먹통이 나는데 무슨 문제일까요?? 제가 했던 순서는 제로초님 말대로 그냥 로컬 : git commit -am " ~comit msg" git push origin master에서 git에 등록한 후 ubuntu 접속: sudo git pull sudo npm run build 아래의 캡처본과 같이 여기서 자꾸 동작이 멈추게 되네요... pm2 kill하고도 해봤고 pm2를 그대로 실행시킨 상태에서도 해도 똑같네요... 어딜 고쳐야하는 걸까요? (로컬에서 npm run build하면 제대로 작동하고 위의 경우에도 인스턴스 중지 후 다시 재시작해서 build하면 제대로 작동해요)
코드 작성 후 정상적으로 실행이 되었는데 갑자기 재실행을 하면 8005 번 포트에서 대기 중 몽고디비 연결 성공 chat 네임스페이스에 접속 C:\Users\juren\OneDrive\바탕 화면\Node\chapter12\gif-chat\socket.js:29 .split('/')[referer.split('/').length - 1] ^ TypeError: Cannot read property 'split' of undefined at Namespace.<anonymous> (C:\Users\juren\OneDrive\바탕 화면\Node\chapter12\gif-chat\socket.js:29:8) at Namespace.emit (events.js:315:20) at Namespace.emit (C:\Users\juren\OneDrive\바탕 화면\Node\chapter12\gif-chat\node_modules\socket.io\lib\namespace.js:213:10) at C:\Users\juren\OneDrive\바탕 화면\Node\chapter12\gif-chat\node_modules\socket.io\lib\namespace.js:181:14 at processTicksAndRejections (internal/process/task_queues.js:75:11) [nodemon] app crashed - waiting for file changes before starting... 이런 에러가 나오면서 실행이 되지않습니다.. 그리고 저 에러가 나고 나서?? 채팅방에 사용자가 0명일때 채팅방이 삭제되는 부분도 삭제는 정상적으로 되는데 새로고침을 해줘야만 삭제된상태로 나옵니다.. 왜 그런걸까요 제로초님..
안녕하세요. 쿠키 관련 질문이 있습니다. front에서 axios로 보낼 때 withcredentials: true 를 해주고 backend에서도 cors에서 credentials : true를 해주었기 때문에 로컬에서 프론트와 백엔드를 같이 돌릴 경우에는 쿠키 공유 문제가 없습니다. 그런데 백엔드를 aws EC2에 두고 프론트 엔드를 로컬에서 돌릴 경우 쿠키가 공유되지 않습니다. 원인은 samesite 정책 때문이고 해결하려면 backend에서 쿠키를 보낼 때 samesite=none과 secure:true를 같이 적용해줘야 한다는 걸 알았습니다. 이를 해결하려면 결국 https 적용을 위해 nginx로 프록시를 만들어 줘야 하는데 다른 방법이 있을까요? 간단한 방법은 로컬에서 계속 테스트 하다가 배포관련 수업에서 하는 것 처럼 도메인을 같이 등록하면 되긴 하지만 이런 경우에도 해결하는 방법이 있는지 궁금합니다.
(node:17608) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\oksos\Desktop\study\PTE\loginWeb\client\node_modules\postcss-safe-parser\node_modules\postcss\package.json. Update this package.json to use a subpath pattern like "./*". (Use `node --trace-deprecation ...` to show where the warning was created) createProxyMiddleware is not a function
로그인을 하면 세션까지는 올바르게 잘 넣어집니다. 그런데 deserializeUser를 실행할때 findOne을 findAll로 실행하면 req.user까지만 되고 나머지 user.id user.nick 등이 받아와지지 않습니다. findAll 과 findOne에 id를 조건으로 입력하면 같은 결과가 나온다고 생각했는데 왜 안되는지 혹시 알려주실수 있나요 ㅠㅠ
안녕하세요 제로초님 Node.js 교과서를 사서 열심히 수업을 듣고 있는 한 학생입니다! 다름이 아니고 유튜브를보며 노드교과서 개정판 4-5. 쿠키 이해하기에서 코드 질문이 있어서 여쭤보러 왔습니다. 이것은 되는 코드이고 const parseCookies = ( cookie = '' ) => cookie . split ( ';' ) . map ( v => v . split ( '=' )) . reduce (( acc , [ k , v ]) => { acc [ k . trim ()] = decodeURIComponent ( v ) return acc ; }, {}); 이것은 안되는 코드입니다. const parseCookies = ( cookie = '' ) => { cookie . split ( ';' ) . map ( v => v . split ( '=' )) . reduce (( acc , [ k , v ]) => { acc [ k . trim ()] = decodeURIComponent ( v ) return acc ; }, {}); }; 둘의 차이점은 함수를 {} 로 감싸냐 안감싸냐의 차이인데 화살표함수에서 중괄호는 선택사항이라고 배웠습니다. 만약 아래 코드를 사용하게 되면 (node:9452) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined at Server.<anonymous> (C:\Users\ksy\Desktop\Node.js\ch04\ex03\cookie2.js:30:22) at Server.emit (events.js:315:20) at parserOnIncoming (_http_server.js:874:12) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) (Use `node --trace-warnings ...` to show where the warning was created) (node:9452) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:9452) [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. 라는 에러가 뜹니다. 함수를 제대로 사용하지 못해서 그런거 같은데 왜 중괄호를 붙이면 함수가 실행이 안되는건지 궁금합니다
npm install -D @babel/preset-env 라 적혀 있는데 실제론 npm install @babel/preset-env 라고 하기도 하고.... -D가 dev에 추가한다. 라고는 알고 있는데, 실제로 바벨 프리셋들은 dev에 했을 때와 아닐때 차이가 없나요? 아니면 차이점으로 어떤 것들이 있나요?
간단한 궁금증입니다.. map()과 forEach()의 세세한 차이점은 검색을 해봤는데 map메소드가 보통 성능 면에서도 더 빠르고 기존의 데이터를 변형시키지 않고 새로운 배열을 반환하기 때문에 기존 데이터가 필요한 경우에도 쓸 수 있을 것 같다는 생각이 들었습니다. 강사님은 각각 어떤 경우에 map()과 forEach()를 사용하시는지 여쭤보고 싶습니다!
reducers 폴더의 index파일의 rootReducer함수에서 defalut: return state 들어가는이유 설명해주실때 액션타입해서 그 다음상태 만들어주는것을 처리해주는대 리듀서 초기화할때 또 rootReducer함수가 실행이되는대 그때defalut: return state이 부분이 없으면 리턴값이 undefined된다 이렇게 설명해주셨는대 리듀서가 왜 초기화되는지 이유가 궁금합니다!