묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
영상에 갑자기 자막이 같이 나와요
소리랑 안 맞기도 하고 화면 밑부분을 보여주실 때 자막에 가려서 안 보입니다ㅜ
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
samesite=none 일 때 쿠키 공유 문제
안녕하세요. 쿠키 관련 질문이 있습니다. front에서 axios로 보낼 때 withcredentials: true 를 해주고 backend에서도 cors에서 credentials : true를 해주었기 때문에 로컬에서 프론트와 백엔드를 같이 돌릴 경우에는 쿠키 공유 문제가 없습니다. 그런데 백엔드를 aws EC2에 두고 프론트 엔드를 로컬에서 돌릴 경우 쿠키가 공유되지 않습니다. 원인은 samesite 정책 때문이고 해결하려면 backend에서 쿠키를 보낼 때 samesite=none과 secure:true를 같이 적용해줘야 한다는 걸 알았습니다. 이를 해결하려면 결국 https 적용을 위해 nginx로 프록시를 만들어 줘야 하는데 다른 방법이 있을까요? 간단한 방법은 로컬에서 계속 테스트 하다가 배포관련 수업에서 하는 것 처럼 도메인을 같이 등록하면 되긴 하지만 이런 경우에도 해결하는 방법이 있는지 궁금합니다.
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
리덕스 툴킷 유튜브 영상
안녕하세요, 제로초님 강의 잘 보고 있습니다. 예전에 유튜브에 리덕스 툴킷영상이 올라갔던걸로 기억하고, 봐야지... 하고 있었는데 없어졌네요?? 영상에 문제가 있어서 내리셨나요??
-
해결됨[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
passport-naver
passport-naver을 이용해보려 하는데 porfile.displayName 값이 계속 undefind여서 nick값에 들어가지가 않습니다... naver 앱등록할때 권한도 다 설정 해줬는데 왜 정보를 받아오지 못할까요 제로초님 ㅠㅠ const passport = require('passport'); const NaverStrategy = require('passport-naver').Strategy; const User = require('../models/user'); module.exports = () => { passport.use(new NaverStrategy ({ clientID: process.env.NAVER_ID, // 네이버에서 발급받을 ID clientSecret: process.env.NAVER_SECRET, callbackURL: '/auth/naver/callback', // 네이버로부터 인증결과를 받을 라우터 주소 }, async (accessToken, refreshRoken, response, done) => { // 네[이버에서 인증 후 Token 과 profile을 보내준다. console.log('naver profile', response); try { const exUser = await User.findOne({ // 기존의 User가 있는지 조회 where: { snsId: response.id, provider: 'naver' }, }); if(exUser) { // 기존 User의 정보가 있다면 User정보를 done과 호출하고 전략을 종료 done(null, exUser); } else { // 기존의 User정보가 없다면 회원가입을 진행 const newUser = await User.create({ email: response.emails[0].value, nick: response.id, snsId: response.id, provider: 'naver', naver: response._json }); done(null, newUser); // 사용자 생성 후 done함수 호출 } } catch (error) { console.log(error); done(error); } })); }; 이렇게 작성했습니다 naver profile { provider: 'naver', id: '60727489', displayName: undefined, emails: [ { value: 'juren528@gmail.com' } ], _json: { email: 'juren528@gmail.com', nickname: undefined, profile_image: undefined, age: undefined, birthday: undefined, id: '60727489' } } 가져온 결과 콘솔로 확인해보니 이렇게 나오구요 좀더 공부해보려다 안되서 막막합니다 ㅠㅠ 혹시 이유를 아실까요 ㅠㅠ
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
이런 에러는 왜 생기는건가요?
(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
-
해결됨[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
deserializeUser findAll()실행시 로그인 성공 후 화면이 그대로입니다.
로그인을 하면 세션까지는 올바르게 잘 넣어집니다. 그런데 deserializeUser를 실행할때 findOne을 findAll로 실행하면 req.user까지만 되고 나머지 user.id user.nick 등이 받아와지지 않습니다. findAll 과 findOne에 id를 조건으로 입력하면 같은 결과가 나온다고 생각했는데 왜 안되는지 혹시 알려주실수 있나요 ㅠㅠ
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
Node.js 교과서
안녕하세요 제로초님 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. 라는 에러가 뜹니다. 함수를 제대로 사용하지 못해서 그런거 같은데 왜 중괄호를 붙이면 함수가 실행이 안되는건지 궁금합니다
-
해결됨프론트엔드 개발환경의 이해와 실습 (webpack, babel, eslint..)
npm install -D
npm install -D @babel/preset-env 라 적혀 있는데 실제론 npm install @babel/preset-env 라고 하기도 하고.... -D가 dev에 추가한다. 라고는 알고 있는데, 실제로 바벨 프리셋들은 dev에 했을 때와 아닐때 차이가 없나요? 아니면 차이점으로 어떤 것들이 있나요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
선생님 질문있습니다.
다른분이 질문하신건데 9:30초에 const productId = props.match.params.productId; 여기서 props.match.params.productId 가 어디서 나온건지 잘 모르겠습니다 ㅠㅠ. App.js 에서 Auth로 감싸줘서 props가 있는건 알겠는데 match.params.productId가 어디서 나온건지 모르겠네요 ㅠㅠ App.js -> hoc/auth.js -> user_actions.js->index.js-> routes/users.js 까지 가봤는데 잘 모르겠네요 ㅠㅠ
-
[리뉴얼] React로 NodeBird SNS 만들기
propery 'nickname' of undefined
삭제된 글입니다
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
세팅 제이슨
세팅 제이슨을 검색하면 그랩님 화면과 다르게 엄청나게 많은 코드가 뜨는데 제가 잘못 검색한건지, 그냥 이 밑에 그대로 코드를 추가하면 되는지 궁금합니다. 그리고 프리티어가 꼭 필요한지도 궁금합니다. 프리티어 없이 써왔어서 있고 없고의 차이가 현저할까요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
이번 강의 users.js에서 map() 대신 forEach()를 사용한 이유
간단한 궁금증입니다.. map()과 forEach()의 세세한 차이점은 검색을 해봤는데 map메소드가 보통 성능 면에서도 더 빠르고 기존의 데이터를 변형시키지 않고 새로운 배열을 반환하기 때문에 기존 데이터가 필요한 경우에도 쓸 수 있을 것 같다는 생각이 들었습니다. 강사님은 각각 어떤 경우에 map()과 forEach()를 사용하시는지 여쭤보고 싶습니다!
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
이 에러는 왜나는걸까요?ㅠㅠ
그동안 강의보면서 에러나도 어찌저찌 잘 넘겼는데 ㅠㅠ 이번 에러는 조금 감이 안오네요 ㅠㅠ writer가 유효하지 않게 넘어가는 건지 ㅠㅠ 이유가 있을까요?
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
rootReduecer함수에서 리듀의 초기화
reducers 폴더의 index파일의 rootReducer함수에서 defalut: return state 들어가는이유 설명해주실때 액션타입해서 그 다음상태 만들어주는것을 처리해주는대 리듀서 초기화할때 또 rootReducer함수가 실행이되는대 그때defalut: return state이 부분이 없으면 리턴값이 undefined된다 이렇게 설명해주셨는대 리듀서가 왜 초기화되는지 이유가 궁금합니다!
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
user를 찾을 수 없다고 나와요ㅠㅠㅠㅠ
AppLayout에서 store에서 IsLoggedIn 가져오는데서 에러가 발생합니다. const isLoggedIn = useSelector((state) => state.user.isLoggedIn); 에러 코드 TypeError: Cannot read property 'user' of undefined const initialState = { user: { isLoggedIn: false, user: null, signUpdata: {}, loginData: {}, }, post: { mainPosts: [], }, }; const rootReducer = (state = initialState, action) => { switch (action.type) { case "LOG_IN": return { ...state, user: { ...state.user, isLoggedIn: true, user: action.data, }, }; case "LOG_OUT": return { ...state, user: { ...state.user, isLoggedIn: false, user: null, }, }; default: return; } }; 뭐가 문제일까여...힝ㅜㅜㅜㅜ
-
해결됨따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
ORM에 대해 질문드립니다.
이전 질문은 보니 관계형 데이터 베이스로도 강의를 제작할 계획이 있다고 하셨는데요 1. 존안님께서 실무에서 쓰는 DB는 MySQL 인가요?? 2. 그럼 ORM 종류는 무엇으로 하시나요? 시퀼라이즈, 프리즈마.. 등등 어떤것으로 사용하시나요?
-
미해결리액트로 나만의 블로그 만들기(MERN Stack)
새로고침시 로그인이 유지 되지 않습니다.
되게 여러번 따라 했는데, 새로고침 하고난 후 로그인이 유지가 되지 않습니다..ㅠㅠ authSaga 속의 함수들이 제대로 작동하지 않는것 같습니다.... authoSaga속 함수를 호출하는 시작이 어딘지 순서 또한 잘 파악되지 않습니다..ㅠ 계속 401에러가 뜹니다. ㅠㅠ
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
12강, POST를 보내면 [ERR_HTTP_HEADERS_SENT] 에러
- Postman으로 email, PW를 보내며 '비밀번호가 틀렸습니다' 가 Response로 돌아오면서 아래 에러가 나옵니다... 비번은 분명 맞는데 이런 에러가 나옵니다ㅜ 혹시 이유를 알 있나요? - 좀 길지만 전체 코드 복붙했습니다. 감사합니다! CODE ERROR _http_outgoing.js:558 throw new ERR_HTTP_HEADERS_SENT('set'); ^ Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at ServerResponse.setHeader (_http_outgoing.js:558:11) at ServerResponse.header (/Users/user/VS Code/project_with_NodeJS/boiler-plate/node_modules/express/lib/response.js:771:10) at ServerResponse.send (/Users/user/VS Code/project_with_NodeJS/boiler-plate/node_modules/express/lib/response.js:170:12) at ServerResponse.json (/Users/user/VS Code/project_with_NodeJS/boiler-plate/node_modules/express/lib/response.js:267:15) at /Users/user/VS Code/project_with_NodeJS/boiler-plate/index.js:48:20 at /Users/user/VS Code/project_with_NodeJS/boiler-plate/models/user.js:62:9 at /Users/user/VS Code/project_with_NodeJS/boiler-plate/node_modules/bcrypt/bcrypt.js:210:13 at processTicksAndRejections (internal/process/task_queues.js:75:11) { code: 'ERR_HTTP_HEADERS_SENT' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! boiler-late@1.0.0 start: `node index.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the boiler-late@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! /Users/user/.npm/_logs/2020-12-28T03_02_38_926Z-debug.log
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
name, email, password가 전달이 안됩니다.
보시다시피, 모든 소스 코드 다 제대로 설정한 거 같은데 안됩니다. 도대체 뭘 수정해야 할까요? 무료로 양질의 강의를 제공해주셔서 진심으로 감사드립니다.
-
미해결프론트엔드 개발환경의 이해와 실습 (webpack, babel, eslint..)
프로젝트 생성
초반에 프로젝트 생성 파트를 보고있습니다. node.js를설치후 강좌에서 본것처럼 npm 을 타이핑 하였지만 Uncaught ReferenceError: npm is not defined 이라는 메세지만 나타납니다. 그리고 프로젝트 생성하실때 강좌에서는 mkdir sample 그리고 cd sample후에 sample npm init를 치시면 프로젝트 생성 이 되는데 저는 mkdir sample을 타이핑하면 Uncaught SyntaxError: Unexpected identifier이 나타납니다. 이유를 알고싶습니다. 강좌보고 5분만에 막히네요 ㅜㅜ;;