자유게시판 대댓글 등록 & 조회 기능 구현을하는데 playground에서 회원정보 인증에서 오류가 발생합니다. 피그마 상에서도 일반회원에 대한 내용만 있고 비회원일 경우없는 것을 보면 대댓글 기능 자체가 로그인이 되어있을 경우를 상정한건가요? 일단 docs에는 유저토큰 정보를 요구하지는 않는데... 회원정보가 필요한가요? 대댓글 자유게시판에서 대댓글기능 작동하는 건가요...?
유저 api 하나 간단히 만드는 줄 알았는데.. 리팩터링하고 또하고 모델과 컨트롤러 파일로 만들고 (모르신다면 MVC 패턴) 에러 핸들링의 기초까지 싹 다 훑어버림 1시간도 안되는 강의지만 조심하세요 프린이 여러분들...근데 잘보면 뒤에 계속 API를 추가하기 때문에 여기서 정신차리셔야합니다... 꺾였지만 계속 가는 마음이 중요합니다 고고
가비아 에서 도메인 결제 후 터미널 dig 부분에서 막혀서 질문 드립니다. 가비아 AWS 여기까지 잘 따라 왔는데 터미널에서 오류가 뜨네요 강의에서 2-3일 걸릴수도 있다했는데 현재 6시간 이상 지나도 안돼서 궁금함에 질문 남겨요.. 기다리면 될까요? 아님 잘못한 부분이 있을까요?
터미널에 다음과 같은 경고가 뜹니다. warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works TypeError: Failed to fetch at webpack_require .hmrM ( http://localhost:3000/_next/static/chunks/webpack.js?ts=1690436755699:1201:20 ) 작성한 코드 AppLayout.js import { Menu } from "antd"; import Link from "next/link"; import PropTypes from "prop-types"; import React from "react"; const items = [ { label: ( <Link href="/"> <a>홈</a> </Link> ), key: "home", }, { label: <Link href="/profile">프로필</Link>, key: "profile", }, { label: ( <Link href="/signup"> <a>회원가입</a> </Link> ), key: "signup", }, ]; function AppLayout({ children }) { return ( <div> <Menu mode="horizontal" items={items}></Menu> {children} </div> ); } AppLayout.propTypes = { children: PropTypes.node.isRequired, }; export default AppLayout; index.js import React from "react"; import AppLayout from "../components/AppLayout"; function Home() { return ( <AppLayout> <div>Hello, Next!</div> </AppLayout> ); } export default Home; Fast Refresh 관련 문서를 보고 새로 고침도 해보고, 캐시도 지워보고, 익명 함수를 기명 함수로 바꿔보았지만 소용이 없었습니다. npm run dev를 실행하고 localhost에 접속할 때마다 보입니다. 웹페이지 우측 하단에 vercel mark 같은 것이 잠시 깜빡이는데 그 때에도 fast refresh 관련 warnning이 뜹니다. next.js 12 버전, antd 5버전을 사용 중이며 질문 시점에 강의는 Section1의 1강 수강 했습니다.
안녕하세요! 다음과 같이 hook 이 선언되기 전에 if조건문 이 위치하여 오류가 발생하였습니다. useMutation 은 조건문이 실행되기 전에 선언해주면 해결되었는데 useQuery 는 router 를 사용하기 때문에 조건문보다 먼저 선언이 될 수 없었습니다. 그래서 조건문을 없애기 위해서 router.query.boardId 를 string타입 으로 변환하여도 상관이 없나요? 1차 오류 발생 if (!router || typeof router.query.boardId !== "string") return <></>; const { data } = useQuery< Pick<IQuery, "fetchBoardComments">, IQueryFetchBoardCommentsArgs >(FETCH_BOARD_COMMENTS, { variables: { boardId: router.query.boardId }, }); const [deleteBoardComment] = useMutation< Pick<IMutation, "deleteBoardComment">, IMutationDeleteBoardCommentArgs >(DELETE_BOARD_COMMENT); //오류 원인 React Hook "useMutation" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? const { data } = useQuery< //string으로 변환 const { data } = useQuery< Pick<IQuery, "fetchBoardComments">, IQueryFetchBoardCommentsArgs>(FETCH_BOARD_COMMENTS, { variables: { boardId: String(router.query.boardId) }, });
(클릭한 버튼만 loading이 되게 해놓은 상태에서) 서로 다른 두개의 팔로우 버튼을 빠르게(1초안에) 클릭했을때 요청이 두번가는데 두번째거만 성공하는 이유는 takeLatest를 사용해서 그런것이 맞나요? 둘다 성공시키기 위해 takeEvery를 사용했는데 그래도 될까요? function* watchFollow() { yield takeEvery(FOLLOW_REQUEST, follow); } function* watchUnfollow() { yield takeEvery(UNFOLLOW_REQUEST, unfollow); } 그리고 혹시 takeLatest를 써도 서버에 여러개의 요청이 가니까 서버에서 여러 요청을 모두 성공하게끔 처리가 될까요?
apoll-cilent 관련된 질문입니다. 질문1. 지금 강의에서는 api url이 한개만 있을 경우인데, 경로가 다 다른 경우는 어떻게 연결을 하나요?? client를 여러개 만들어서 porivder에 담아줘야하나요?? 질문2. provider는 꼭 app.jsx를 감싸야하나요?? 아니면 내부 컴토넌트안에서 원하는 컴포넌트를 provider로 감싸도 동일하게 사용이 가능한가요??
31-2 포트폴리오 과제를 진행하다가 막혀서 질문드려요!! 다른기능들은 이미 해봤던내용의 복습인것같아 잘진행을 하고있던 와중에 별점 기능을 구현하는데 어려움이 좀 있네요. 처음 만들어보는 기능이라 혼자 만들어보다가 잘진행이 되지않아 레퍼런스 코드를 한번보고싶은데요 해당 과제 세션에 링크된 레퍼런스코드에는 그기능이 따로 없는것같아서 여쭈어봅니다.
npm run dev를 했는데 아래와 같은 오류가 뜨면서 실행이 안됩니다 어디서 문제가 있는 건가요? util/produce.js 코드 내용 import { enableES5, produce } from 'immer'; export default (...args) => { enableES5(); return produce(...args); }; 터미널 에러 > react-nodebird-front@1.0.0 dev > next -p 3060 ready - started server on 0.0.0.0:3060, url: http://localhost:3060 event - compiled client and server successfully in 668 ms (1830 modules) wait - compiling / (client and server)... event - compiled client and server successfully in 1185 ms (4446 modules) 4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined } {} wait - compiling /_error (client and server)... error - util/produce.js (4:11) @ __WEBPACK_DEFAULT_EXPORT__ error - TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.enableES5) is not a function at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///./util/produce.js:11:53) at reducer (webpack-internal:///./reducers/user.js:115:106) at /Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:476:24 at Array.forEach (<anonymous>) at assertReducerShape (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:474:25) at combineReducers (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:539:5) at eval (webpack-internal:///./reducers/index.js:19:75) { page: '/' } 2 | 3 | export default (...args) => { > 4 | enableES5(); | ^ 5 | return produce(...args); 6 | }; event - compiled client and server successfully in 315 ms (4447 modules) 4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined } {} TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.enableES5) is not a function at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///./util/produce.js:11:53) at reducer (webpack-internal:///./reducers/user.js:115:106) at /Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:476:24 at Array.forEach (<anonymous>) at assertReducerShape (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:474:25) at combineReducers (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:539:5) at eval (webpack-internal:///./reducers/index.js:19:75) at processTicksAndRejections (node:internal/process/task_queues:96:5) ^C%
강의에 나온 대로 아무리 해도 계속 서버 에러가 뜨네요. 이전에 질문했던 codegen 까지 설치 완료 해서 제대로 작동이 되는데 이 페이지만 실행시키면 계속 오류가 발생합니다. 저가 뭘 잘못한 걸까요? import { useQuery, gql } from "@apollo/client"; import type { IQuery, IQueryFetchBoardArgs, } from "../../../src/commons/types/generated/types"; const FETCH_BOARDS = gql` query { fetchBoards { _id writer title contents } } `; export default function StaticRoutingMovedPage() { const { data } = useQuery<Pick<IQuery, "fetchBoards">, IQueryFetchBoardArgs>( FETCH_BOARDS ); console.log(data?.fetchBoards); return ( <div> {data?.fetchBoards.map((el) => ( <div key={el._id}> <span style={{ margin: "10px" }}>{el.title}</span> <span style={{ margin: "10px" }}>{el.writer}</span> </div> ))} </div> ); }
따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
안녕하세요 강의 영상 잘 보고 있습니다. next.js 설치를 강의영상과 동일하게 명령어로 설치하는데 디렉토리 구조가 영상과 달라서 문의드립니다. 별것 아닌 문제긴 한데 pages 폴더가 제쪽에는 설치가 되지 않아서 경로설정등의 소소한 차이가 생겨서 문의드립니다. 감사합니다