안녕하세요 제로초님. 강의 잘 보고 있습니다. <img src={ photo.link } alt={ photo.Post ?.content} /> <div className={style.image} style={{backgroundImage: `url(${ photo.link })`}} /> 여기서 css를 보니 img에 display none을 주고 div에 style의 bg로 이미지를 주셨던데 왜 이렇게 하신건지 특별한 이유가 있나요? 궁금합니다.
병렬 라우팅에 문제가 있는 거 같아 문의 드립니다. 강의 그대로 패러렐 라우트, 인터셉터 라우트까지 모두 따라했었는데, "Application error: a client-side exception has occurred (see the browser console for more information)." 브라우저에 이런 에러가 뜨면서, 콘솔창에는 아래와 같이 에러가 뜨더라구요. app-index.js:33 Warning: Cannot update a component (`HotReload`) while rendering a different component (`Router`). To locate the bad setState() call inside Router , follow the stack trace as described in https://reactjs.org/link/setstate-in-render at Router (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:207:11) at ErrorBoundaryHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:113:9) at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11) at AppRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:585:13) at ServerRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:112:27) at Root (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:117:11) window.console.error @ app-index.js:33 Show 1 more frame Show lessUnderstand this error react-dom.development.js:9126 Uncaught TypeError: initialTree is not iterable at applyPatch (apply-router-state-patch-to-tree.js:17:53) at applyRouterStatePatchToTree (apply-router-state-patch-to-tree.js:74:30) at applyRouterStatePatchToTree (apply-router-state-patch-to-tree.js:76:30) at eval (navigate-reducer.js:142:88)Understand this error app-index.js:33 The above error occurred in the <Router> component: at Router (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:207:11) at ErrorBoundaryHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:113:9) at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:160:11) at AppRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:585:13) at ServerRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:112:27) at Root (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:117:11) React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundaryHandler. 그래서 어디서 난 에러인지 추리려고 인터셉터 라우트 부분은 아예 빼버리고, 패러랠 라우트 부분으로 확인해보는데, 패러랠 라우트 부분부터 아예 에러가 나서 이것이 문제인 거 같더라구요. { "name": "z-com", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "classnames": "^2.5.1", "dayjs": "^1.11.13", "next": "14.2.11", "react": "^18", "react-dom": "^18" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.4.20", "eslint": "^8", "eslint-config-next": "14.2.11", "postcss": "^8.4.47", "tailwindcss": "^3.4.12", "typescript": "^5" } } package.json과 디렉토리 구조는 이런 상태이구요. @modal/compose/tweet/page.tsx @modal/compose/tweet/modal.module.css @modal/default.tsx 이 세 파일은 깃헙 ch2-2 에 나온대로 그대로 적었습니다. import {ReactNode} from "react"; import style from '@/app/(afterLogin)/layout.module.css'; import Link from "next/link"; import Image from "next/image"; import ZLogo from '../../../public/zlogo.png'; import NavMenu from "@/app/(afterLogin)/_component/NavMenu"; import LogoutButton from "@/app/(afterLogin)/_component/LogoutButton"; import TrendSection from "@/app/(afterLogin)/_component/TrendSection"; import FollowRecommend from "@/app/(afterLogin)/_component/FollowRecommend"; // import RightSearchZone from "@/app/(afterLogin)/_component/RightSearchZone"; type Props = { children: ReactNode, modal: ReactNode } export default function AfterLoginLayout({ children, modal }: Props) { return ( <div className={style.container}> <header className={style.leftSectionWrapper}> <section className={style.leftSection}> <div className={style.leftSectionFixed}> <Link className={style.logo} href="/home"> <div className={style.logoPill}> <Image src={ZLogo} alt="z.com로고" width={40} height={40} /> </div> </Link> <nav> <ul> <NavMenu /> </ul> <Link href="/compose/tweet" className={style.postButton}> <span>게시하기dd</span> {/* <svg viewBox="0 0 24 24" aria-hidden="true" className="r-jwli3a r-4qtqp9 r-yyyyoo r-1472mwg r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-lrsllp"><g><path d="M23 3c-6.62-.1-10.38 2.421-13.05 6.03C7.29 12.61 6 17.331 6 22h2c0-1.007.07-2.012.19-3H12c4.1 0 7.48-3.082 7.94-7.054C22.79 10.147 23.17 6.359 23 3zm-7 8h-1.5v2H16c.63-.016 1.2-.08 1.72-.188C16.95 15.24 14.68 17 12 17H8.55c.57-2.512 1.57-4.851 3-6.78 2.16-2.912 5.29-4.911 9.45-5.187C20.95 8.079 19.9 11 16 11zM4 9V6H1V4h3V1h2v3h3v2H6v3H4z"></path></g></svg> */} </Link> </nav> <LogoutButton /> </div> </section> </header> <div className={style.rightSectionWrapper}> <div className={style.rightSectionInner}> <main className={style.main}>{children}</main> <section className={style.rightSection}> {/* <RightSearchZone /> */} <TrendSection /> <div className={style.followRecommend}> <h3>팔로우 추천</h3> <FollowRecommend /> <FollowRecommend /> <FollowRecommend /> </div> </section> </div> </div> {modal} </div> ) } layout.tsx도 위에 코드와 같이 거의 그대로 적었구요. 참고로 layout.tsx에서 console.log(modal) 했을 때, undefined 뜹니다. 근데 또 explore로 이동한 뒤 게시하기 버튼을 누르면 modal이 뜹니다. 이것 저것 다해보다가 도저히 안풀려서 문의드립니다. 제가 어디서 놓친 걸까요...
$ npm run build > instagram-clone@0.1.0 build > next build ▲ Next.js 14.2.12 - Environments: .env Creating an optimized production build ... ✓ Compiled successfully Linting and checking validity of types .Failed to compile. Linting and checking validity of types ...next/types/app/page.ts:8:13 Type error: Type 'OmitWithTag<typeof import("D:/Study/React/next/Supabase/instagram-clone/app/page"), "config" | "generateStaticParams" | "revalidate" | "dynamic" | "dynamicParams" | "fetchCache" | "preferredRegion" | ... 6 more ... | "generateViewport", "">' does not satisfy the constraint '{ [x: string]: never; }'. Property 'matadata' is incompatible with index signature. Type 'Metadata' is not assignable to type 'never'. 6 | 7 | // Check that the entry is a valid entry > 8 | checkFields<Diff<{ | ^ 9 | default: Function 10 | config?: {} 11 | generateStaticParams?: Function 빌드할때 오류뜹니다 .next 안에 있는 오류인데 지웠다 다시 해도 똑같아요 어떻게 해야 할까요??
안녕하세요 제로초님 강의를 듣다가 문득 궁금한점이 있어서 질문드립니다. 현재 폴더 구조가 app하위에 (afterLogin) 폴더와 (beforeLogin) 폴더가 있는데, 지금 강의에서는 당연한듯이 beforeLogin 폴더의 layout이 뜨고있는데요, 왜 그런건지 궁금합니다. 현재 단계에서는 뭔가 로그인을 했다는 조건같은걸 아직 작성하지 않은것 같아서요 정리하자면 현재 localhost:3000 의 기본 페이지가 afterlogin 폴더의 layout이 아니라 beforeloign의 layout이 뜨는 이유가 궁금합니다.
아래 방법을 진행하고 앱을 실행해도 앱이 사용자의 위치를 사용하도록 허용하시겠습니까? 라는 알림이 나오지를 않습니다. 혹시 방법이 있을까요!? 방법 1. 설정 -> 개발자 -> Xcode 프로젝트 빌드 파일 -> 2개 삭제 방법 2. npx react-native start --reset-cache 방법 3. yarn cache clean
프로젝트 빌드 시, 안드로이드는 곧바로 시뮬레이터가 열리고 앱이 빌드되는데, iOS는 시뮬레이터가 열리고 시간이 한~~~~~참 지나야 앱이 빌드됩니다. 원래 이렇게 시간차이가 많이나나요? 안드로이드는 1분만에 되는것같던데 iOS는 거의 5분정도 걸리네요.. 참고로 코드는 아무것도 없고 프로젝트 초기화 시 입니다. m1 air 16GB, 512입니다. ❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, ReactNative 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요. (일부만 잘라서 올리지 말아주세요.)
❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, ReactNative 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요. (일부만 잘라서 올리지 말아주세요.) [2-0] 강좌를 진행중에 있습니다. yarn start 를 실행하면 Welcome 화면이 나오는데.. 강사님이 실행한 것 처럼 npx react-native run-ios 를 실행하면 bundle error 가 나네요.
❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, ReactNative 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요. (일부만 잘라서 올리지 말아주세요.) XCode 로 실행시켜보라는 강사님의 말대로 실행시켜 보았습니다. 그런데 이런 오류가 나네요.. jsbundle file을 그냥 생성해주면 되나요? 어떻게 해야하는 걸까요?
❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, ReactNative 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요. (일부만 잘라서 올리지 말아주세요.) 이거 뭐 이렇게 어려워서야... 하라는 대로 해도 안되고 밀고 해도 안되고. ㅎㅎㅎㅎㅎㅎㅎ
안녕하세요, 강사님 제가 강사님 강의를 보고, CODEPUSH를 적용해보고자하는데, 제가 만약에 .env에 CODEPUSH_ANDROID_APP_SECRET=adsfasdfas 이렇게 환경변수로 정의했다고 하면, appcenter-config.json 파일에서 이렇게 해도 인식이 될까요? ```json { "app_secret": "{CODEPUSH_ANDROID_APP_SECRET}" } ``` 아니면, 이런 코드푸시 키는, 그냥 깃허브에 공개해도 상관없는지가 궁금합ㄴ디ㅏ!
안녕하세요, 채팅 관련 부분에, reverseInfiniteQuery를 적용할 수 있을 것 같아, 도전해보던 찰나에 잘 안되어서 질문드립니다!! 혹시 역무한스크롤 방식으로 할 수 있는 방법이 있을까요?? 보통 실무에서 채팅을 어떠한 방식으로 구현하는지 매우 궁금합니다. 1. 역무한 스크롤 방식 2. 계속해서 refetch를 하는 방식
안녕하세요 강의 잘 보고 있습니다. 한가지 질문이 있는데요! 라우팅 테스트 중에 (beforeLogin) 하위로 추가 생성되는 라우트는 Link로 접속하면 잘 되는데, 직접 URL로 치고 가면 not-found 페이지가 뜨는데 어떤 이유일까요 ? 질문1) 아래 이미지의 itest 폴더 인터셉팅 잘됨. 하지만 새로고침 하거나 직접 localhost:3000/itest 치고 들어가면 페이지 없음. (원래는 새로고침 시 page.tsx 내용이 보여야 하지 않나요?) 질문2) 테스트겸 localhost:3000/dkwlsWK 라우트를 생성해서 직접 URL치고 들어가니 역시 없는 페이지로 뜹니다. 혹시 (그룹핑) 하거나 페레럴을 사용한 것과 연관이 있을까요 ? 질문3) 아래 이미지 중 @modal/(.)itest 에 default.tsx 로 하면 에러가 나더라구요! (page.tsx로 하면 괜찮지만 페이지를 찾을 수 없음)
안녕하세요 강사님 안드로이드 버전 관련해서 해결 후에 ios를 실행할 때 아래와 같이 오류가 발생합니다..ㅜㅜ 제가 아무래도 이전에 아래와 같은 명령어를 실행했던게 문제가 되지 않았을까 추측이 됩니다..ㅠㅠ 혹시 어떤 문제가 발생한걸까요.. yarn remove react-native-maps 실행 yarn add react-native-maps@1.8.3 실행 node_modules 디렉터리 삭제 yarn 명령으로 패키지 설치 npx pod-install ios 실행 cd android 명령으로 android 디렉터리 이동 rm -rf .gradle 실행 ./gradlew clean 실행 npm run android, npm run ios 로 재빌드하여 실행 시도 1 cd ios rm -rf Pods rm -rf Podfile.lock pod install Xcode -> Product -> Clean build folder -> xcode 18버전 업그레이드 시도 2 18버전 업그레이드 후에 발생하는 오류입니다..ㅠㅠ 아래 블로그 내용을 보았지만 use_flipper라는 텍스트가 존재하지 않습니다..ㅠㅠ https://positiveko-til.vercel.app/til/react-native/flipper-error.html
안녕하세요 강사님 수준높은 강의 정말 감사합니다. 회원가입, 로그인 구현중 에러가 나서 질문드립니다. 제가 섹션4 인증 기능 구현하기 [3-8] React Query 도입(2) - 로그인 연동하기 구현중에 있습니다. 회원가입시 db 까지는 insert가 등록은 잘됩니다. select 해보니깐 user 테이블에 회원가입이 잘되었더라구요 하지만 로그인후 페이지 이동? 이되지가 않는데 front 에서는 에러가 나지 않고 server 에서만 이렇게 에러가 나더라구요 그래서 제가 uploads 폴더에 제대로 복사를 하지 않은줄 알았는데 server 에서는 uploads 폴더가 없더라구요? 그래서 이게 front 에서 잡아야하는 문제인지 server 에서 잡아야하는 문제인지 좀 헷갈리는데 제가 혹시 server 설정중 빠트린부분이 있어서 에러가 나는걸까요?
안녕하세요, Supabase 인증강좌를 너무 잘 들었습니다! 혹시 smtp 추가 강좌는 언제 추가 될 예정인지 알 수 있을까요?? 또 추가적으로, Supabase에 큰 관심이 생겨서, 학습해보면서, 개인 블로그를 제작해보고자 하는데 보통 서버비용을 얼마정도로 예상하면 될지, 뭔가 요금 같은거를 대시보드 형태로 쉽게 볼 수 있는 방법이 있는지도 궁금합니다!
안녕하세요. 강의를 복습하다가 캐싱 기능에 대해 질문이 생겼습니다. Next에서 fetch의 cache: 'force-cache'를 설정하면, 데이터가 공적 캐싱으로 처리된다고 알고 있습니다. 여기서 게시판을 예로 들어보면, 게시물을 새로 포스팅하면 전체 게시물 목록을 갱신해야 하기 때문에 서버에서는 cache: 'no-store'를 설정하여 항상 최신 데이터를 가져오고, 클라이언트에서는 qn을 이용해서 staleTime을 설정하여 데이터를 일정 시간 동안 캐싱하고 있습니다. "force-cache"와 "useQuery" 내 두 번의 캐싱이 발생하여 비 효율적일 수 있다고 생각되어 cache: 'no-store'를 사용하여 클라이언트에서만 캐싱하고 있었는데요. 생각해보니 fetch를 이용해서 공적으로 캐싱하는게 성능적으로 우월할거 같아서 "force-cache"로 변경하고 invalidateQueries를 이용하여 클라이언트에서 post되면 데이터를 갱신하도록 변경하고 테스트를 해보았는데 잘되는게 이해가 되질 않습니다. 서버는 초기 항상 캐싱된 데이터를 반환하기 때문에 데이터가 상이할줄 알았는데 터미널을 봐도 post하고 리스트를 갱신할때만 Api 호출하고 이후엔 캐싱된 데이터를 잘 사용합니다. 이 경우, 사용자가 데이터를 갱신하면 서버의 캐시가 자동으로 업데이트되고, 공적 캐싱을 사용하여 효율적으로 데이터를 관리할 수 있는 건가요?
❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, ReactNative 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요. (일부만 잘라서 올리지 말아주세요.) 1-5 과정을 진행중에 있습니다. 맥 M1 을 사용하고 있고 npx react-native@0.72.6 init MatzipApp --version 0.72.6 로 생성했습니다. yarn start 한 후에 ios 를 실행하려면 simulator 가 나타난 후 세번째 이미지 마지막 커서에서 멈춰서 더 이상 작동하지 않습니다. cd ios rm -rf Pods rm -rf Podfile.lock pod install 위 코드도 실행해봤고요. Derived Data 에 있는 해당 폴더도 삭제해 봤는데 잘 안되네요. ㅡㅡ;