묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
tfjs-node 안깔려서
tfjs-node 안깔려서 해보라고 하는거 해보다가잘 되던 nodemon server.js 도 안되고 뭐가 잘못됐는지 모르겠습니다.빨리 마무리하고 싶은데 답답하네요강의 업데이트 좀 해주셨으면 좋겠는데 생각 없으신가요
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
mongoose save() 어쩌구 에러나시는 분들
app.post('/register',(req,res)=>{ //회원가입할 때 필요한 정보들을 client에서 가져오면, //그 정보들을 DB에 넣어준다. const user = new User(req.body); //user모델에 정보가 저장됨 //실패 시, 실패한 정보를 보내줌 user.save().then(()=>{ res.status(200).json({ success:true }) }).catch((err)=>{ return res.json({success:false,err}) }); })
-
해결됨파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트
suggestion에서 onFollowUser을 수행할때 에러 질문입니다!
import React from "react"; import { Button, Avatar } from "antd"; import "./Suggestion.scss"; //프레젠테이션 컴포넌트라 할 수 있다 export default function Suggestion({ suggestionUser, onFollowUser }) { const { username, avatar, is_follow } = suggestionUser; return ( <div className="suggestion"> <div className="avatar"> <Avatar icon={<img src={avatar} alt={`${username}'s avatar`} />} /> {/* <UserAddOutlined /> */} </div> <div className="usesrname">{username}</div> <div className="action"> {is_follow && "팔로잉 중"} {!is_follow && ( <Button size="small" onClick={() => onFollowUser(username)}> Follow </Button> )} </div> </div> ); } import React, { useEffect, useState } from "react"; import "./SuggestionList.scss"; import { Card } from "antd"; import Suggestion from "./Suggestion"; import { useAppContext } from "store"; import Axios from "axios"; import useAxios from "axios-hooks"; export default function SuggestionList({ style }) { const { store: { jwtAccessToken }, } = useAppContext(); const [userList, setUserList] = useState([]); //axios을 좀더 일반적으로 쓰기위한 훅을 이용 useAxios hook //useEffect자체가 필요없다 요청자체를 useAxios가 보내게 되니까? //useAxios는 조회를 할때는 유용한다 post을 할때는 코드가 복잡해진다? const headers = { Authorization: `Bearer ${jwtAccessToken}` }; const [{ data: origUserList, loading, error }, refetch] = useAxios({ url: "http://127.0.0.1:8000/accounts/suggestions/", headers, }); useEffect(() => { if (!origUserList) setUserList([]); else setUserList(origUserList.map((user) => ({ ...user, if_follow: false }))); }, [origUserList]); const onFollowUser = (username) => { console.log("성공"); try { Axios.post( "http://127.0.0.1:8000/accounts/follow/", { username }, { headers } ) .then((response) => { setUserList((prevUserList) => { return prevUserList.map((user) => { if (user.username === username) { return { ...user, is_follow: true }; } else return user; }); }); }) .catch((error) => { console.log(error); }); } catch (error) { console.log("여기 에러야 :", error); } }; return ( <div style={style}> {/* 정말 빠르게 지나갈 것이다 */} {loading && <div>Loading...</div>} {error && <div>로딩중에 에러가 발생했습니다.</div>} {/* <button onClick={() => refetch()}>Reload</button> */} <Card size="small" title="Suggestions for you" // extra={<a href="#">More</a>} style={{ width: 300, }} > {userList.map((suggestionUser) => ( <Suggestion key={suggestionUser.username} suggestionUser={suggestionUser} onFollowUser={onFollowUser} //속성값으로 주입함 /> ))} </Card> </div> ); } 첫번째 블럭이 Suggestion.js이고 두번째 블럭은 SuggestionList.js입니다.follow 버튼을 눌렀을때 이러한 에러가 뜨기 시작했는데 왜 그런걸까요ㅠㅠ 분명 원래는 잘 되었는데 학습진도를 더 나가다 보니 어느순간 작동하지 않던데 그 이유를 잘 모르겠습니다 서버쪽으로 요청도 가지 않는거 같은데 서버쪽의 문제일 수 있을까요??
-
미해결너네 백엔드 하고 싶은 거 있으면 얼마든지 해 난 괜찮어 왜냐면 나는 파이어베이스가 있어
next js 에는 browserRouter가 없어서 상태에 맞는 화면을 어떻게 노출하나요?
next js 에는 browserRouter가 없어서 상태에 맞는 화면을 어떻게 노출하나요?로그인 전후에 따라서 표시하는 페이지를 어떻게 비슷하게 만들 수 있는지 궁금합니다.
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
route에서 res.status(201).json시 undefined
안녕하세요 선생님게시글 수정을 route에서 처리하고 마지막으로 res.status(201).json(fullPost) 이렇게 게시글 정보를 담아서 보내려는데 자꾸 사가에서 데이터를 undefined로 받습니다..담기 전에 fullPost를 콘솔로 찍어보면 데이터가 잘 들어가 있는데 프론트로 넘어가면 undefined로 바뀌어요.그래서 단순 문자열도 res.status(201).json('성공');이런 식으로 보내봤는데도data가이렇게 undefined로 뜨는건 어느 부분을 봐야 하는 건가요?
-
미해결따라하며 배우는 리액트 A-Z[19버전 반영]
오류 질문
검색을 해보니 컴포넌트 명 관련해서 에러 라고 나와져있는데 소스 를 확인해봐도 오타 문제는 아닌거같아 강사님께 여쭤봅니다 ㅠㅜ 무슨문제일까요 ?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
writeHead 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. Location에 /login만 해놓으니까 오류만 뜨고 로그인페이지로 안가고 커뮤니티 페이지로 들어가져서 경로를 아래처럼 바꿔더니 로그인페이지로 잘 가지긴 하는데 단순 경로 문제인가요??오류도 정상적으로 쿠키가 없다고 뜹니다
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
useSelector의 적절한 사용법에 대해 궁금합니다.
안녕하세요 제로초님. 강의 내용과는 다를 수 있지만... 확실한 대답을 얻기가 어려워서 질문 드립니다 ㅜㅜ리덕스 툴킷 + useSelector에 대해 질문이 있습니다.기존에는 다음과 같이 구조 분해 할당을 사용해왔습니다.const { id, name } = useSelector((state:RootState) => state.user)하지만 최근에 이 방법이 굉장한 안티 패턴이라는 것을 알게 되었고 다른 방법을 찾고 있습니다.공식 문서에 기반하면 총 3개 정도의 방법이 있는 것 같아요.state를 하나씩 불러오도록 useSelector를 여러번 사용.const id = useSelector((state: RootState) => state.user.id)const name = useSelector((state: RootState) => state.user.name)구조 분해 할당 + equalityFn 사용 (shallowEqual 등)RTK에서 제공하는 createSelector 사용. 공식 문서를 읽어보니 1번을 제일 추천하는 뉘앙스로 느꼈습니다. 저도 1번이 가장 심플하면서도 정확한 방법 같아요. 하지만 걱정되는게 한 컴포넌트에서 불러와야 할 상태가 많다면 useSelector가 굉장히 많아져서 가독성을 해지지 않을까 고민입니다.하나의 슬라이스에 상태가 많은 경우도 있어서요.(많이 사용할수록 전체적인 코드의 볼륨이 더 커질 수도 있을 것 같구요..) 2번은 경우에 따라 shallowEqual이 중첩된 객체는 검사하지 못한다는 점, equalityFn을 일일이 설정해줘야한다는 점에서 오히려 공수가 더 많이 들지 않을까 고민입니다. 3번은 단순히 값만 불러오는 것 보다 불러오는 동시에 복잡한 연산이 있을 때 권장되는 방법으로 느껴졌습니다. 메모이제이션이 갖고 있는 트레이드 오프도 있구요. 각 스토어 슬라이스마다 또는 각 컴포넌트마다 사용한다면 너무 과하게 사용하는 것이 아닌가 고민입니다. 어떤 방법을 사용하는 것이 가장 괜찮은 방법일까요?아니면 따로 추천하시는 방법이 있으신가요? 열심히 구글을 돌아다녔지만 딱 명확한 대답을 얻기가 힘들어서 부득이하게 질문 드립니다...
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
로그인페이지, 회원가입페이지 못들어가게하는 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 이 부분에서 axios.get으로 보내주는 쿠키가 없는데 어떻게 유저가 로그인을 했다는게 인증되는건가요??
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
강의에서 사용하고 있는 next.js 버전으로 설치는 어떻게 하나요?
현재 next.js를 설치하려고 하면 13.2버전으로 설치가 되고 딱히 특정 버전을 설치해주는 기능은 없는 듯 합니다. 13버전과 강의에서 쓰이는 12버전은 사뭇 다르다고 생각이 듭니다.해당 강의에서 쓰고 있는 버전이 정확히 뭔지. 그리고 해당 버전으로 다운그레이드 혹은 설치를 하려면 어떻게 해야하는지 알려주실 수 있나요?
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
flyctl 관련 재문의 드립니다.
flyctl deploy가 진행이 안돼서제 컴퓨터에 있는 도커를 삭제하고 다시 실행했더니아래와 같은 상태에서 멈췄습니다.구글링 해봐도 잘 모르겠어요 ㅠㅠ어떻게 해결하면 될까요? C:\Users\dahye\Documents\react-project\d-market-server>flyctl deploy ==> Verifying app config--> Verified app config==> Building imageRemote builder fly-builder-quiet-sunset-984 ready==> Building image with Buildpacks--> docker host: 20.10.12 linux x86_6420: Pulling from heroku/buildpacksDigest: sha256:1dd1a9c5f291b47fed1aed3f4c348fdc878380319c15f0e09753a5898482554eStatus: Image is up to date for heroku/buildpacks:2020-cnb: Pulling from heroku/herokuDigest: sha256:c9d053a463c7cd81672a3b0d5d5e26bdcbdffe2782565ccbedc15867b8cddfb9Status: Image is up to date for heroku/heroku:20-cnbWarning: Platform requested deprecated API '0.6'===> DETECTINGWarning: Buildpack 'heroku/ruby@0.0.0' requests deprecated API '0.4'Warning: Buildpack 'heroku/python@0.0.0' requests deprecated API '0.4'Warning: Buildpack 'heroku/scala@0.0.0' requests deprecated API '0.4'Warning: Buildpack 'heroku/php@0.0.0' requests deprecated API '0.4'Warning: Buildpack 'heroku/go@0.0.0' requests deprecated API '0.4'Warning: Buildpack 'heroku/gradle@0.0.0' requests deprecated API '0.4'2 of 3 buildpacks participatingheroku/nodejs-engine 0.8.16heroku/nodejs-npm 0.5.2===> ANALYZINGPrevious image with name "registry.fly.io/d-market-server:cache" not found===> RESTORING===> BUILDING[Heroku Node.js Engine Buildpack][Checking Node.js version]Detected Node.js version range: *Resolved Node.js version: 19.7.0[Installing Node.js distribution]Downloading Node.js 19.7.0Extracting Node.js 19.7.0Installing Node.js 19.7.0[INFO] Installing toolbox[INFO] - yj[INFO] Using npm v9.5.0 from Node[INFO] Installing node modules from ./package-lock.jsonnpm WARN config production Use --omit=dev instead.WARN failed to finish build in graphql: Post "https://api.fly.io/graphql": context canceledOops, something went wrong! Could you try that again?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
Section Quiz7 에서 질문이 있습니다.
퀴즈7에 있는 소주제 : 컴포넌트 재사용성과 수정 프로세스에서 질문이 있습니다.updateProduct로 수정하는 부분인데요.페이지 모두 만들었는데. 여기서 수정이 완료 됐다고 하는데 데이터가 null값으로 들어가네요..밑에는 container페이지와 queries페이지 입니다.어느 부분이 잘못됏는지 모르겠어서 질문드립니다. http://practice.codebootcamp.co.kr/graphql 에서 create부분에선 seller를 바로 받아오는데 밑에서는 productId로 받아옵니다. 이렇게 된다면 수정페이지 에서는 seller 는 수정 못하게 되는건가요?
-
미해결너네 백엔드 하고 싶은 거 있으면 얼마든지 해 난 괜찮어 왜냐면 나는 파이어베이스가 있어
저는 여기 css 파트에서 li가 점 . 으로 보이는데 안보이게 어떻게 하신건가요?
import styles from './Nav.module.css' import Link from 'next/link' export default function Nav() { return( <nav className={styles.nav}> <h1 className={styles.title}>두근 두근 비밀일기</h1> <ul className={styles.list_nav}> <li><Link href={'/login'}>로그인</Link></li> <li><Link href={'/signup'}>가입하기</Link></li> </ul> </nav> ) } li 태그가 그대로 * 점으로 표기되면서로그인가입하기이런식으로 보이는데 선생님 화면에서는 점 표시가 안보이는데 어떤 차이때문인가요?
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
flyctl 배포 관련 에러 문의드립니다.
cmd창에서 flyctl deploy를 실행하면 아래와 같은 에러가 뜹니다.도커 빌더 이미지 관련 오류인것 같은데 어떻게 해결해야 하나요?urce: failed to fetch builder image 'index.docker.io/heroku/buildpacks:20': resolve auth for ref index.docker.io/heroku/buildpacks:20: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in %PATH%, out: ``
-
미해결Slack 클론 코딩[실시간 채팅 with React]
[공유] react-mention 항상 커서 위에 나오게 수정
이전 질문을 보면 react-mention 추천이 커서 아래로 나온다고 해서 공식 문서를 확인해봤습니다.결론적으로는 forceSuggestionsAboveCursor을 사용하면 됩니다. 해당 내용은 제로초님 sleact 레파지토리에 pull request 하였습니다.allowSuggestionsAboveCursor는 아래 공간이 부족하면 위에 배치가 '가능'하도록, 즉 워크스페이스 사람이 적으면 아래로 배치forceSuggestionsAboveCursor는 항상 위로 배치allowSuggestionsAboveCursor: Renders the SuggestionList above the cursor if there is not enough space belowforceSuggestionsAboveCursor: Forces the SuggestionList to be rendered above the cursor
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
Use 'import type' 에러 및 eslintrc.json
1. 강의를 똑같이 따라했는데 위와같은 메시지가 뜹니다!import 말고 import type을 쓰라는데 멘토님과 다르게 왜 이런 에러가 일어나는건가요?2. 저는 class파일에 eslintrc.json파일이 없어서 화면보고 그냥 따라 적기만 했는데 문제가 없을까요?
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
context에 관해서 질문드립니다.
DiaryStateContext.provider 2중으로 넣는 부분 질문드립니다 .<DiaryStateContext.provider value={data} > 만 써야 되는 이유로 onCreate,onEdit,onRemove 등은 data의 상태가 변경될떄(c,u,d) 마다 리렌더링이 생겨서 최적화가 풀린다고 하셨는데 상태가 변경된다는 말이 onCreate 할떄 data에 실제 생성 ,변경, 삭제 되는 그 로직으로 인한 배열데이터가 변경된다는 말인건가요 ? 그리고. context가 App.js로 부터 data만 받을떄 어차피 onCreate,onEdit,onRemove 함수호출당시에도 data가 변경되고 setData로 변경이 된후에는 어쩃든 data가 추가든 삭제든 수정이든 변경이 될텐데 그러면 app 컴포넌트에서 바뀐 data로 DiaryStateContext 로 데이터를 다시 내려 줄꺼고 그러면 그 하위에 있던 컴포넌트 들은 다시 리렌더링 되지 않을까요 ?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
BoardWrite.presenter의 작성자 input 값의 defaultValue
BoardWrite부분의 presenter의 작성자 부분에defaultValue값에 자꾸 오류가 떠서 문의드립니다.비밀번호나 내용부분과 같이 다른 input창의 defaultValue에는 문제가 생기지 않는데 왜 유독 작성자 부분에만 에러가 뜨는지 모르겠습니다. 그런데 멘토님 파일에는 이전시간에 배우지 않았던 readOnly부분이 추가되어있고 defaultValue값도 수정되어있더라구요! readOnly에 대한 부분은 구글링을통해 왜 쓰는지는 알았지만 뒤에 {!!props.~~} 왜 이렇게 선언하는지와,defaultValue부분에 || "" 부분이 왜 들어가는지 모르겠습니다ㅠ
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
로그인이 안되는데 백엔드까지 되돌리고 싶어요
[Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60, [Symbol(kBytesRead)]: 1312, [Symbol(kBytesWritten)]: 198, [Symbol(RequestTimeout)]: undefined }, _header: 'GET /user/login/posts?lastId=0 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 21, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user/login/posts?lastId=0', _ended: true, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 404, statusMessage: 'Not Found', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:3060/user/login/posts?lastId=0', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 18, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:3060/user/login/posts?lastId=0', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], cookie: [Array], 'user-agent': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 404, statusText: 'Not Found', headers: AxiosHeaders { 'cache-control': 'no-store, must-revalidate', 'x-powered-by': 'Next.js', etag: '"97a-kcoLbH4v9/9OC6V5ZJ+Im5f6nEk"', 'content-type': 'text/html; charset=utf-8', vary: 'Accept-Encoding', date: 'Tue, 28 Feb 2023 17:16:27 GMT', connection: 'close', 'transfer-encoding': 'chunked', [Symbol(defaults)]: null }, config: { transitional: [Object], adapter: [Function: httpAdapter], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [AxiosHeaders], baseURL: 'http://localhost:3060', withCredentials: true, method: 'get', url: '/user/login/posts?lastId=0', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /user/login/posts?lastId=0 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user/login/posts?lastId=0', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: [Writable], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(kUniqueHeaders)]: null }, data: '<!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>: An unexpected error has occurred</title><noscript data-n-css="true"></noscript><link rel="preload" href="/_next/static/chunks/main.js?ts=1677604587215" as="script"/><link rel="preload" href="/_next/static/chunks/webpack.js?ts=1677604587215" as="script"/><link rel="preload" href="/_next/static/chunks/pages/_app.js?ts=1677604587215" as="script"/><noscript id="__next_css__DO_NOT_USE__"></noscript><style data-styled="" data-styled-version="5.3.6"></style></head><body><script src="https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2022%2Ces2021%2Ces2020"></script><div id="__next"><div style="color:#000;background:#fff;font-family:-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body { margin: 0 }</style><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">An unexpected error has occurred<!-- -->.</h2></div></div></div></div><script src="/_next/static/chunks/react-refresh.js?ts=1677604587215"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{"lastId":"0"},"buildId":"development","isFallback":false,"gip":true,"head":[["meta",{"name":"viewport","content":"width=device-width"}],["meta",{"charSet":"utf-8"}],["title",{"children":": An unexpected error has occurred"}]]}</script><script nomodule="" src="/_next/static/chunks/polyfills.js?ts=1677604587215"></script><script src="/_next/static/chunks/main.js?ts=1677604587215"></script><script src="/_next/static/chunks/webpack.js?ts=1677604587215"></script><script src="/_next/static/chunks/pages/_app.js?ts=1677604587215"></script><script src="/_next/static/development/_buildManifest.js?ts=1677604587215"></script><script src="/_next/static/development/_ssgManifest.js?ts=1677604587215"></script></body></html>' } } { type: 'LOAD_USER_POSTS_FAILURE', error: '<!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>: An unexpected error has occurred</title><noscript data-n-css="true"></noscript><link rel="preload" href="/_next/static/chunks/main.js?ts=1677604587215" as="script"/><link rel="preload" href="/_next/static/chunks/webpack.js?ts=1677604587215" as="script"/><link rel="preload" href="/_next/static/chunks/pages/_app.js?ts=1677604587215" as="script"/><noscript id="__next_css__DO_NOT_USE__"></noscript><style data-styled="" data-styled-version="5.3.6"></style></head><body><script src="https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2022%2Ces2021%2Ces2020"></script><div id="__next"><div style="color:#000;background:#fff;font-family:-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body { margin: 0 }</style><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">An unexpected error has occurred<!-- -->.</h2></div></div></div></div><script src="/_next/static/chunks/react-refresh.js?ts=1677604587215"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{"lastId":"0"},"buildId":"development","isFallback":false,"gip":true,"head":[["meta",{"name":"viewport","content":"width=device-width"}],["meta",{"charSet":"utf-8"}],["title",{"children":": An unexpected error has occurred"}]]}</script><script nomodule="" src="/_next/static/chunks/polyfills.js?ts=1677604587215"></script><script src="/_next/static/chunks/main.js?ts=1677604587215"></script><script src="/_next/static/chunks/webpack.js?ts=1677604587215"></script><script src="/_next/static/chunks/pages/_app.js?ts=1677604587215"></script><script src="/_next/static/development/_buildManifest.js?ts=1677604587215"></script><script src="/_next/static/development/_ssgManifest.js?ts=1677604587215"></script></body></html>' } 1. getProps created store with state { user: { loadMyInfoLoading: false, loadMyInfoDone: false, loadMyInfoError: null, loadUserLoading: false, loadUserDone: false, loadUserError: null, followLoading: false, followDone: false, followError: null, unfollowLoading: false, unfollowDone: false, unfollowError: null, logInLoading: false, logInDone: false, logInError: null, logOutLoading: false, logOutDone: false, logOutError: null, signUpLoading: false, signUpDone: false, signUpError: null, changeNicknameLoading: false, changeNicknameDone: false, changeNicknameError: null, loadFollowingsLoading: false, loadFollowingsDone: false, loadFollowingsError: null, loadFollowersLoading: false, loadFollowersDone: false, loadFollowersError: null, removeFollowerLoading: false, removeFollowerDone: false, removeFollowerError: null, me: null, userInfo: null }, post: { mainPosts: [], singlePost: null, imagePaths: [], hasMorePosts: true, likePostLoading: false, likePostDone: false, likePostError: null, unlikePostLoading: false, unlikePostDone: false, unlikePostError: null, loadPostLoading: false, loadPostDone: false, loadPostError: null, loadPostsLoading: false, loadPostsDone: false, loadPostsError: null, addPostLoading: false, addPostDone: false, addPostError: null, removePostLoading: false, removePostDone: false, removePostError: null, addCommentLoading: false, addCommentDone: false, addCommentError: null, uploadImagesLoading: false, uploadImagesDone: false, uploadImagesError: null, retweetLoading: false, retweetDone: false, retweetError: null } } { type: 'LOAD_USER_POSTS_REQUEST', data: 'login' } { type: 'LOAD_MY_INFO_REQUEST' } { type: 'LOAD_USER_REQUEST', data: 'login' } { type: '@@redux-saga/CHANNEL_END' } 4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined } 4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined } AxiosError: Request failed with status code 404 at settle (C:\JS_workspace\React\js_prepare\front\node_modules\axios\dist\node\axios.cjs:1261:12) at Unzip.handleStreamEnd (C:\JS_workspace\React\js_prepare\front\node_modules\axios\dist\node\axios.cjs:2444:11) at Unzip.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [Function: httpAdapter], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: null }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Cookie: '', 'User-Agent': 'axios/1.1.2', 'Accept-Encoding': 'gzip, deflate, br', [Symbol(defaults)]: [Object] }, baseURL: 'http://localhost:3060', withCredentials: true, method: 'get', url: '/user/login/posts?lastId=0', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 965656, [Symbol(kHandle)]: null, [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60, [Symbol(kBytesRead)]: 1312, [Symbol(kBytesWritten)]: 198, [Symbol(RequestTimeout)]: undefined }, _header: 'GET /user/login/posts?lastId=0 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 23, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user/login/posts?lastId=0', _ended: true, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 404, statusMessage: 'Not Found', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:3060/user/login/posts?lastId=0', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 18, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:3060/user/login/posts?lastId=0', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], cookie: [Array], 'user-agent': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 404, statusText: 'Not Found', headers: AxiosHeaders { 'cache-control': 'no-store, must-revalidate', 'x-powered-by': 'Next.js', etag: '"97a-oa4gEZ9VQR+Dh2MJsRlW/Zuu95Q"', 'content-type': 'text/html; charset=utf-8', vary: 'Accept-Encoding', date: 'Tue, 28 Feb 2023 17:16:27 GMT', connection: 'close', 'transfer-encoding': 'chunked', [Symbol(defaults)]: null }, config: { transitional: [Object], adapter: [Function: httpAdapter], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [AxiosHeaders], baseURL: 'http://localhost:3060', withCredentials: true, method: 'get', url: '/user/login/posts?lastId=0', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /user/login/posts?lastId=0 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user/login/posts?lastId=0', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: [Writable], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(kUniqueHeaders)]: null }, data: '<!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>: An unexpected error has occurred</title><noscript data-n-css="true"></noscript><link rel="preload" href="/_next/static/chunks/main.js?ts=1677604587289" as="script"/><link rel="preload" href="/_next/static/chunks/webpack.js?ts=1677604587289" as="script"/><link rel="preload" href="/_next/static/chunks/pages/_app.js?ts=1677604587289" as="script"/><noscript id="__next_css__DO_NOT_USE__"></noscript><style data-styled="" data-styled-version="5.3.6"></style></head><body><script src="https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2022%2Ces2021%2Ces2020"></script><div id="__next"><div style="color:#000;background:#fff;font-family:-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body { margin: 0 }</style><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">An unexpected error has occurred<!-- -->.</h2></div></div></div></div><script src="/_next/static/chunks/react-refresh.js?ts=1677604587289"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{"lastId":"0"},"buildId":"development","isFallback":false,"gip":true,"head":[["meta",{"name":"viewport","content":"width=device-width"}],["meta",{"charSet":"utf-8"}],["title",{"children":": An unexpected error has occurred"}]]}</script><script nomodule="" src="/_next/static/chunks/polyfills.js?ts=1677604587289"></script><script src="/_next/static/chunks/main.js?ts=1677604587289"></script><script src="/_next/static/chunks/webpack.js?ts=1677604587289"></script><script src="/_next/static/chunks/pages/_app.js?ts=1677604587289"></script><script src="/_next/static/development/_buildManifest.js?ts=1677604587289"></script><script src="/_next/static/development/_ssgManifest.js?ts=1677604587289"></script></body></html>' } } { type: 'LOAD_USER_POSTS_FAILURE', error: '<!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>: An unexpected error has occurred</title><noscript data-n-css="true"></noscript><link rel="preload" href="/_next/static/chunks/main.js?ts=1677604587289" as="script"/><link rel="preload" href="/_next/static/chunks/webpack.js?ts=1677604587289" as="script"/><link rel="preload" href="/_next/static/chunks/pages/_app.js?ts=1677604587289" as="script"/><noscript id="__next_css__DO_NOT_USE__"></noscript><style data-styled="" data-styled-version="5.3.6"></style></head><body><script src="https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2022%2Ces2021%2Ces2020"></script><div id="__next"><div style="color:#000;background:#fff;font-family:-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body { margin: 0 }</style><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">An unexpected error has occurred<!-- -->.</h2></div></div></div></div><script src="/_next/static/chunks/react-refresh.js?ts=1677604587289"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{"lastId":"0"},"buildId":"development","isFallback":false,"gip":true,"head":[["meta",{"name":"viewport","content":"width=device-width"}],["meta",{"charSet":"utf-8"}],["title",{"children":": An unexpected error has occurred"}]]}</script><script nomodule="" src="/_next/static/chunks/polyfills.js?ts=1677604587289"></script><script src="/_next/static/chunks/main.js?ts=1677604587289"></script><script src="/_next/static/chunks/webpack.js?ts=1677604587289"></script><script src="/_next/static/chunks/pages/_app.js?ts=1677604587289"></script><script src="/_next/static/development/_buildManifest.js?ts=1677604587289"></script><script src="/_next/static/development/_ssgManifest.js?ts=1677604587289"></script></body></html>' } AxiosError: Request failed with status code 404 at settle (C:\JS_workspace\React\js_prepare\front\node_modules\axios\dist\node\axios.cjs:1261:12) at Unzip.handleStreamEnd (C:\JS_workspace\React\js_prepare\front\node_modules\axios\dist\node\axios.cjs:2444:11) at Unzip.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [Function: httpAdapter], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: null }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Cookie: '', 'User-Agent': 'axios/1.1.2', 'Accept-Encoding': 'gzip, deflate, br', [Symbol(defaults)]: [Object] }, baseURL: 'http://localhost:3060', withCredentials: true, method: 'get', url: '/user', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: 'localhost', _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 965660, [Symbol(kHandle)]: null, [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60, [Symbol(kBytesRead)]: 1307, [Symbol(kBytesWritten)]: 177, [Symbol(RequestTimeout)]: undefined }, _header: 'GET /user HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 22, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user', _ended: true, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 404, statusMessage: 'Not Found', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://localhost:3060/user', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 18, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://localhost:3060/user', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], cookie: [Array], 'user-agent': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 404, statusText: 'Not Found', headers: AxiosHeaders { 'cache-control': 'no-store, must-revalidate', 'x-powered-by': 'Next.js', etag: '"96e-3UMFuq1OQMITCj8aIaMUGQiLzzU"', 'content-type': 'text/html; charset=utf-8', vary: 'Accept-Encoding', date: 'Tue, 28 Feb 2023 17:16:27 GMT', connection: 'close', 'transfer-encoding': 'chunked', [Symbol(defaults)]: null }, config: { transitional: [Object], adapter: [Function: httpAdapter], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [AxiosHeaders], baseURL: 'http://localhost:3060', withCredentials: true, method: 'get', url: '/user', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /user HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Cookie: \r\n' + 'User-Agent: axios/1.1.2\r\n' + 'Accept-Encoding: gzip, deflate, br\r\n' + 'Host: localhost:3060\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/user', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', protocol: 'http:', _redirectable: [Writable], <h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">An unexpected error has occurred<!-- -->.</h2></div></div></div></div><script src="/_next/static/chunks/react-refresh.js?ts=1677604587296"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"gip":true,"head":[["meta",{"name":"viewport","content":"width=device-width"}],["meta",{"charSet":"utf-8"}],["title",{"children":": An unexpected error has occurred"}]]}</script><script nomodule="" src="/_next/static/chunks/polyfills.js?ts=1677604587296"></script><script src="/_next/static/chunks/main.js?ts=1677604587296"></script><script src="/_next/static/chunks/webpack.js?ts=1677604587296"></script><script src="/_next/static/chunks/pages/_app.js?ts=1677604587296"></script><script src="/_next/static/development/_buildManifest.js?ts=1677604587296"></script><script src="/_next/static/development/_ssgManifest.js?ts=1677604587296"></script></body></html>' }}무한 콘솔창 뜨는거 중간에 강제로 끊었습니다 back-jsonfront-jsonapp.jsconst express = require('express'); const cors = require('cors'); const session = require('express-session'); const cookieParser = require('cookie-parser'); const passport = require('passport'); const dotenv = require('dotenv'); const morgan = require('morgan'); const path = require('path'); const hpp = require('hpp'); const helmet = require('helmet'); const postRouter = require('./routes/post'); const postsRouter = require('./routes/posts'); const userRouter = require('./routes/user'); const hashtagRouter = require('./routes/hashtag'); const db = require('./models'); const passportConfig = require('./passport'); dotenv.config(); const app = express(); db.sequelize.sync() .then(() => { console.log('db 연결 성공'); }) .catch(console.error); passportConfig(); if (process.env.NODE_ENV === 'production') { app.use(morgan('combined')); app.use(hpp()); app.use(helmet()); } else { app.use(morgan('dev')); } app.use(cors({ origin: ['http://localhost:3060', 'nodebird.com'], credentials: true // cookie 전달 })); app.use('/', express.static(path.join(__dirname, 'uploads'))); app.use(express.json()); // app.use(express.urlencoded({ extended: true })); app.use(cookieParser('nodebirdsecret')); app.use(session()); app.use(passport.initialize()); app.use(passport.session({ saveUninitialized: false, resave: false, secret: process.env.COOKIE_SECRET })); app.get('/', (req, res) => { res.send('hello express'); }); app.use('/posts', postsRouter); app.use('/post', postRouter); app.use('/user', userRouter); app.use('/hashtag', hashtagRouter); app.listen(3065, () => { console.log('서버 실행중!'); }); 이전에 했던거 되돌리고싶어요백엔드까지 했던곳으로 되돌리고 다시하고 싶은데 로그인하면 이렇게 무한로딩 되면서 이상한 콘솔창 무한으로 뜹니다 서버 에러 같은데 어딘지 모르겠습니다port ? 404 에러 , asios 에러 ?로그인 안되는데 찾을수가 없습니다
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
user 과 auth에서 인증 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.user.ts하고auth.ts에서이 부분이 같은데user.ts는 유저정보를 가져오기위한 미들웨어이고auth.ts는 인증을 위한 부분인데if(!user)이 둘다 있는 이유가 있을까요?그저 user.ts가 user정보를 가져오는데 조건에 해당하는 user정보가 없으면 안되니까(null) user.ts에 if(!user)이 있는건가요??제가 제대로 이해하고 있는지 헷갈려서요 ㅠㅠㅠ