inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

강의에서 인덱스 페이지는 정적 페이지인 건가요 동적 페이지인 건가요?

해결됨

한 입 크기로 잘라먹는 Next.js

처음에 인덱스 페이지는 정적 페이지인데 그 안에 있는 useSearchParams 훅을 사용해서 오류가 난 걸 해결했잖아요 근데 그 후 빌드를 실행하고 결과를 보니 not found 페이지 외에는 다 동적 페이지로 나오는데 그럼 인덱스 페이지는 정적 페이지인 건가요 동적 페이지인 건가요?

  • react
  • typescript
  • next.js
고고고 댓글 2 좋아요 0 조회수 266

컴포넌트 생성할때 React가 없습니다 type error질문입니다.

해결됨

한 입 크기로 잘라먹는 Next.js

컴포넌트를 새로 만들때 자꾸 React가 없습니다란 TS에러가 납니다... 그래서 React를 import해주면 TS에러가 해결되는데 검색해봐도 모르겠어서 질문남깁니당 import React from 'react' const Loading = () => { return( <div> Loading... </div> ) } export default Loading;

  • react
  • typescript
  • next.js
박혀누 댓글 2 좋아요 0 조회수 242

npx랑 yarn이랑 같이 써도 되나요?

해결됨

기초부터 배우는 Next YTMusic 클론 코딩 (with next.js 14, UI 마스터)

프로젝트 세팅할때는 yarn을 쓰셨는데요. shadcn에서 avatar 설치할때는 npx을 쓰셔서요. 같이 써도 문제가 없나요?

  • react
  • 인터랙티브-웹
  • 클론코딩
  • next.js
  • tailwind-css
  • zustand
박상원 댓글 2 좋아요 0 조회수 465

섹션2 1.2 페이지 이동 및 데이터페칭 관련 질문

해결됨

한 입 크기로 잘라먹는 Next.js

16분 그림을 기준으로 초기 접속 시(SSR방식) : JS번들링(html 렌더링)하고 hydration으로 상호작용이 가능한 페이지로 변환 페이지 이동 시(CSR방식) : 브라우저가 서버에게 별도의 페이지를 추가로 요청하지않고 js를 실행해서 컴포넌트를 교체 뒤에 나오는 섹션의 데이터페칭과 프리페칭에 관해 궁금합니다. SSR에서의 데이터 페칭은 서버가 접속요청을 받고 백엔드 서버로부터 API를 주고받고 JS를 실행해서 렌더링된 HTML을 브라우저에 렌더링하는 것으로 알고 있는데 페이지 이동시에는 CSR방식으로 처리된다고 하셔서 이럴때는 브라우저에 렌더링 후에 데이터페칭을 하는것인지 궁금합니다. 위의 질문과 유사한데 프리페칭이 현재 페이지에 걸려있는 링크들에 대해서 JS번들링을 미리 가져오는것으로 알고있습니다. 그러면 이것들도 데이터 페칭되지 않은 해당 페이지의 리액트 컴포넌트들만을 가져오는 것인가요?

  • react
  • typescript
  • next.js
gga01075 댓글 2 좋아요 0 조회수 243

img에 display: none을 주고 div에 background-img를 주는 이유

미해결

Next + React Query로 SNS 서비스 만들기

안녕하세요 제로초님. 강의 잘 보고 있습니다. <img src={ photo.link } alt={ photo.Post ?.content} /> <div className={style.image} style={{backgroundImage: `url(${ photo.link })`}} /> 여기서 css를 보니 img에 display none을 주고 div에 style의 bg로 이미지를 주셨던데 왜 이렇게 하신건지 특별한 이유가 있나요? 궁금합니다.

  • react
  • next.js
  • react-query
  • next-auth
  • msw
처음끝 댓글 2 좋아요 0 조회수 178

패러랠 라우팅 client-side 에러가 뜹니다.

미해결

Next + React Query로 SNS 서비스 만들기

병렬 라우팅에 문제가 있는 거 같아 문의 드립니다. 강의 그대로 패러렐 라우트, 인터셉터 라우트까지 모두 따라했었는데, "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이 뜹니다. 이것 저것 다해보다가 도저히 안풀려서 문의드립니다. 제가 어디서 놓친 걸까요...

  • react
  • next.js
  • react-query
  • next-auth
  • msw
석봉토스트 댓글 2 좋아요 0 조회수 503

next-auth ./auth.ts 질문입니다 !

미해결

Next + React Query로 SNS 서비스 만들기

import NextAuth from "next-auth" import CredentialsProvider from "next-auth/providers/credentials"; import {NextResponse} from "next/server"; export const { handlers: { GET, POST }, auth, signIn, } = NextAuth({ pages: { signIn: '/i/flow/login', newUser: '/i/flow/signup', }, providers: [ CredentialsProvider({ async authorize(credentials) { const authResponse = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/login`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ id: credentials.username, password: credentials.password, }), }) if (!authResponse.ok) { return null } const user = await authResponse.json() console.log('user', user); return { email: user.id, name: user.nickname, image: user.image, ...user, } }, }), ] }); @/auth.ts 파일 코드입니다. 이런식으로 에러가 나서 에러 창을 확인해보면 전달된 매개변수의 타입이 적절치 않다고 하는데, 강의 그대로 따라가면서 깃허브 참고하면서 코드를 작성했음에도 불구하고 오류가 나옵니다..

  • react
  • next.js
  • react-query
  • next-auth
  • msw
승준 댓글 2 좋아요 0 조회수 282

build 오류

해결됨

[풀스택 완성] Supabase로 웹사이트 3개 클론하기 (Next.js 14)

$ 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 안에 있는 오류인데 지웠다 다시 해도 똑같아요 어떻게 해야 할까요??

  • firebase
  • next.js
  • tailwind-css
  • react-query
  • supabase
br 댓글 2 좋아요 0 조회수 386

Next 빌트인 Image컴포넌트를 사용하지 않는 이유는 뭔가요??

해결됨

한 입 크기로 잘라먹는 Next.js

Next.js에서는 기본적으로 제공하는 빌트인 Image 컴포넌트가 있음에도 불구하고, 강의에서는 일반 HTML img 태그를 사용하고 있습니다. Next.js의 Image 컴포넌트는 이미지 최적화와 같은 여러 이점을 제공하는 것으로 알고 있는데, 왜 이를 사용하지 않고 img 태그를 선택했는지 궁금합니다. 이에 대한 이유나 특별한 상황이 있다면 설명해 주시면 감사하겠습니다.

  • react
  • typescript
  • next.js
장영진 댓글 2 좋아요 0 조회수 317

페이지 이동시 또는 새로고침시 사전랜더링 질문

미해결

한 입 크기로 잘라먹는 Next.js

처음 배울 때에는 브라우저에 요청이 들어올 때 기본적으로 SSR 방식으로 사전 렌더링이 된 후, 하이드레이션 작용이 일어나 그 후 CSR 방식으로 작동된다고 알고 있습니다. 질문하기 쉽게 / 경로를 보여주는 컴포넌트를 Home, book/:id 경로를 보여주는 컴포넌트를 BookDetail 라고 표기하겠습니다. Home 컴포넌트에 getServerSideProps 메서드로 사전 렌더링때 데이터 페칭을 하고, BookDetail 컴포넌트도 getServerSideProps 메서드로 사전 렌더링때 데이터 페칭을 진행 할 수 있도록 둘다 설정해 놓았을 때, 처음 HOME 컴포넌트 접속시 getServerSideProps 메서드가 실행되고 BookDetail 로 이동시 getServerSideProps 도 메서드도 실행됩니다. getServerSideProps 메서드는 사전 랜더링 때 실행이 되는 걸로 알고 있는데, 기존에 Next.js 랜더링 방식은 사전 렌더링 후, 페이지 이동은 CSR 로 진행된다고 배웠습니다. 그렇다면 BookDetail 로 이동시 CSR 방식으로 랜더링 된다면 , BookDetail 의 getServerSideProps 메서드는 실행되지 않아야 하는게 아닌가요 ?

  • react
  • typescript
  • next.js
픽셀소프트웨어 댓글 2 좋아요 2 조회수 257

그룹폴더 질문있습니다.

해결됨

Next + React Query로 SNS 서비스 만들기

안녕하세요 제로초님 강의를 듣다가 문득 궁금한점이 있어서 질문드립니다. 현재 폴더 구조가 app하위에 (afterLogin) 폴더와 (beforeLogin) 폴더가 있는데, 지금 강의에서는 당연한듯이 beforeLogin 폴더의 layout이 뜨고있는데요, 왜 그런건지 궁금합니다. 현재 단계에서는 뭔가 로그인을 했다는 조건같은걸 아직 작성하지 않은것 같아서요 정리하자면 현재 localhost:3000 의 기본 페이지가 afterlogin 폴더의 layout이 아니라 beforeloign의 layout이 뜨는 이유가 궁금합니다.

  • react
  • next.js
  • react-query
  • next-auth
  • msw
seongwoo91 댓글 2 좋아요 0 조회수 121

강의 1.3 백엔드 서버 세팅하기에서 빌드시 에러

해결됨

한 입 크기로 잘라먹는 Next.js

12:22 npm run build 시에 에러가 validator 모듈이 없다고 나오네요 validate-decoration.ts 파일에서 import * as validator from 'validator'; packae.json에 업데이트가 안되어 있는 것 같아요.

  • react
  • typescript
  • next.js
여어 댓글 3 좋아요 0 조회수 309

article / section 태그에 관해

해결됨

기초부터 배우는 Next YTMusic 클론 코딩 (with next.js 14, UI 마스터)

article 과 section tag 를 자주 사용하시는데, 혹시 어떤 기준으로 사용하시나요?

  • react
  • 인터랙티브-웹
  • 클론코딩
  • next.js
  • tailwind-css
  • zustand
femaster1 댓글 1 좋아요 0 조회수 196

혹시 MUI에 대한것도 배우나요?

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

이 강의에서 MUI에 대한 것도 배우는지 궁금합니다.

  • react
  • node.js
  • seo
  • graphql
  • next.js
minchoi9979 댓글 2 좋아요 0 조회수 170

섹션25

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

이건 무슨 오류 일까요?

  • react
  • node.js
  • seo
  • graphql
  • next.js
imhj11777 댓글 2 좋아요 0 조회수 102

2.20 강의 Vercle 에 벡엔드 배포 후 미출력

해결됨

한 입 크기로 잘라먹는 Next.js

안녕하세요. 강좌 잘 보고 있습니다. 다름이 아니라 vercel 에 onebite-books-server 를 배포하였습니다. 로컬에서는 작동을 확인하였습니다. 첫 화면은 잘 나오는데 /api 폴더로 접근시 화면에 swagger 가출력이 안되고 있네요. ㅠㅠ; vercel 로그는 정상 배포 되었구요. 첫화면은 잘 나옵니다. 혹시 환경변수를 셋팅해야 하는가 해서 검토해 보았지만 필요없으시다고 하셔서 그냥 두었습니다. 에러 메시지는 콘솔창에 Failed to load resource: the server responded with a status of 404 () 이런 메시지가 여러개 출력 중입니다. 확인좀 부탁드립니다. 감사합니다.

  • react
  • typescript
  • next.js
억수 댓글 2 좋아요 1 조회수 512

카테고리 변경 시 이미지 로딩

해결됨

기초부터 배우는 Next YTMusic 클론 코딩 (with next.js 14, UI 마스터)

카테고리 관련 강의를 수강 중입니다. 카테고리 변경 시 백그라운드 변경되는 부분이 있는데요 해당 부분이 이미지 로딩(변경?)이 매우 늦게 되더라구요 해당 부분 개선해보려면 어떤 것을 시도해보면 좋을까요?

  • react
  • 인터랙티브-웹
  • 클론코딩
  • next.js
  • tailwind-css
  • zustand
femaster1 댓글 2 좋아요 1 조회수 224

무한스크롤(React Infinite Scroller)의 pageStart

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

16-02-infinite-scroller 강의 중에 이해가 가지 않는 코드가 한줄 있어서 질문드립니다! InfiniteScroll에 pageStart 옵션이 걸려있는데, 이게 어디에 영향을 주는건가요? 초기 페이지 번호라기에는 이 옵션을 999999 처럼 의미 없는 값을 줘도 문제 없이 작동하고 그러네요.. 딱히 의미가 없는 코드 같은데 pageStart라는게 어떤식으로 작동되는건지가 좀 궁금합니다..

  • react
  • node.js
  • seo
  • graphql
  • next.js
ten 댓글 2 좋아요 0 조회수 156

상세 페이지 api관련 궁금증

해결됨

한 입 크기로 잘라먹는 Next.js

책의 정보 상세 페이지에 접근하게 되면 책의 상제 정보 요청과, 책의 리뷰에 대한 api 요청이 이렇게 두가지를 하는데요 혹시 현업에서도 이런 상세 페이지(상품 정보, 댓글이나 상품평 이 필요한 페이지)에서 api요청을 여러번 하게 백엔드 api를 설계 하는 것인가요?? 아니면 두번 요청이 필요한 페이지에 대한 예를 만들기 위해 분리를 해 놓은 것인가요???

  • react
  • typescript
  • next.js
ajrfyd 댓글 2 좋아요 0 조회수 151

인기 태그

인프런 TOP Writers

주간 인기글