안녕하세요! 풀 라우트 캐시 이후 JS Bundle, RSC Payload도 불러오는지 궁금해서 질문해봅니다. Next Link를 통해 페이지를 교체할 때, Next 서버는 JS Bundle과 RSC Payload를 클라이언트로 전송하고, 클라이언트는 이를 적절히 결합하여 페이지를 렌더링하는 것으로 이해했습니다. 만약 초기 접속 시 풀 라우트 캐시되어 있는 static html를 불러온 이후, JS Bundle, RSC Payload도 불러오는지 궁금합니다. 그리고 초기 접속 시 다이나믹 페이지 또한 html을 불러온 이후, JS Bundle, RSC Payload도 불러오는지 궁금합니다. 제 생각은 불러올 것 같지만, 확실히 알면 좋을 것 같아서 질문드려봅니다.
안녕하세요! build할 때 계속해서 type 오류가 발생하여 질문 드립니다. 현재 page.tsx에는 아래와 같이 작성되어 있습니다. import BookItem from "@/components/book-item"; import { BookData } from "@/types"; export default async function Page({ searchParams, }: { searchParams: { q?: string; }; }) { const response = await fetch( `${process.env.NEXT_PUBLIC_API_SERVER_URL}/book/search?q=${searchParams.q}` ); if (!response.ok) { return <div>오류가 발생했습니다...</div>; } const books: BookData[] = await response.json(); return ( <div> {books.map((book) => ( <BookItem key={book.id} {...book} /> ))} </div> ); } 근데 여기서 build를 하면 아래와 같은 에러가 발생합니다. .next/types/app/(with-searchbar)/search/page.ts:34:29 Type error: Type 'Props' does not satisfy the constraint 'PageProps'. Types of property 'searchParams' are incompatible. Type 'Record<string, string | string[]> | undefined' is not assignable to type 'Promise<any> | undefined'. Type 'Record<string, string | string[]>' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag] 32 | 33 | // Check the prop type of the entry function > 34 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>() | ^ 35 | 36 | // Check the arguments and return type of the generateMetadata function 37 | if ('generateMetadata' in entry) { Next.js build worker exited with code: 1 and signal: null 사실 gpt를 이용하여 받은 코드로 작성해보면 에러를 해결할 수는 있는데 이게 근본적인 해결 방법인지 잘 모르겠고, gpt가 작성한 코드가 잘 이해가 되지 않습니다. 우선 gpt에서 받은 답변은 아래와 같습니다. import BookItem from "@/components/book-item"; import { BookData } from "@/types"; export default async function Page({ searchParams }: any) { const qRaw = searchParams?.q; const q = Array.isArray(qRaw) ? qRaw[0] : qRaw ?? ""; const response = await fetch( `${process.env.NEXT_PUBLIC_API_SERVER_URL}/book/search?q=${encodeURIComponent(q)}` ); if (!response.ok) { return <div>오류가 발생했습니다...</div>; } const books: BookData[] = await response.json(); return ( <div> {books.map((book) => ( <BookItem key={book.id} {...book} /> ))} </div> ); } 이렇게 하면 해결은 되긴합니다. 다만 왜 해결이 되는 건지 이해가 잘 되지 않아서 그런데 왜 자꾸 build할 때 type 오류가 발생하는지 알려주시면 감사드리겠습니다!
[질문 내용] final이 붙은 int value를 생성자를 통해 초기화하는 법을 배웠습니다. 그런데, final이 변수 앞에 붙은 경우, 생성자를 통해서 한번만 초기화 될 수 있다고 했는데, 아래 ConstructInit 메서드를 두 번 사용하여 초기화를 두 번 진행한 것을 볼 수 있습니다. 한번만 초기화 할 수 있다고 했는데, 왜 객체를 두개나 생성해서 final int value를 두번 초기화한 것일까요? final int value; public ConstructInit(int value) { this.value = value; } package final1; public class FinalFieldMain { public static void main(String[] args) { //final 필드 - 생성자 초기화 System.out.println("생성자 초기화"); ConstructInit constructInit1 = new ConstructInit(10); ConstructInit constructInit2 = new ConstructInit(20); //한번만 초기화 된다며 System.out.println(constructInit1.value); System.out.println(constructInit2.value); } }
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 인텔리제이 설치하고 설치옵션이 뜨는데 뭘 선택해야되나요?
안녕하세요 강의를 보고 javac에 대해서 궁금한 점이 있어서 질문 드립니다. .class로 컴파일 된 파일을 각각 os에 맞는 자바가 각자의 os에 맞게 바꿔서 실행을 한다고 하셨는데 javac도 java이지 않나요?. 정확한지 모르겠지만 linux에서 컴파일한 .class와 window에서 컴파일한 .class의 값이 다르다면 window에서 컴파일한 .class 파일이 linux에서 실행이 되는 건가요? 모든 os에서 실행이 되려면 .class 파일의 내용은 같아야 될 것 같은데 궁금합니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문 전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 2.람다.pdf 36p MyFunction 은 함수형 인터페이스이며, String apply(String s) => StringFunction 이거죠??
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문 전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 안녕하세요 Future 관련 공부를 하다가 궁금증이 생겨 질문 남겼습니다. ThreadPoolExecutor 객체 안에 FutureTask 객체를 만들고 그 안에 task(Callable 구현 객체)를 보관한다고 알고 있습니다. 그러면 스레드풀에 있는 스레드가 해당 Future 작업을 완료한 후에 main 스레드에서 future.get()으로 값을 반환 받고 난 후에 해당 future 객체는 GC가 알아서 처리해주는건가요?
버젼이 달라서인지.. CNA 했을 때 tailwind.config.js 파일이 없었습니다. 강의에서는 원래부터 존재하던데.. 그래서 어떻게어떻게 추가를 했는데. Error: It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install @tailwindcss/postcss and update your PostCSS configuration. 라는 에러가 끝나지를 않네요 ㅠ GPT한테 열심히 물어봤는데 도저히 해결이 안돼서 문의드립니다. 밑은 제가 설정해둔 코드입니다. tailwind.config.js /** @type {import('tailwindcss').Config} */ module.exports = { content: [ "./src/**/*.{js,ts,jsx,tsx,html,css}", // 필요한 파일들 포함 "./app/**/*.{js,ts,jsx,tsx}", // Next.js의 `app` 폴더 추가 "./components/**/*.{js,ts,jsx,tsx}", // 컴포넌트 폴더 추가 ], theme: { extend: { colors: { 철수가좋아하는색깔: "#3498db", // 나만의 부트스트랩 만들기 영희가좋아하는색깔: "green", }, }, }, plugins: [], }; postcss.config.js module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }; globals.css /* @import "tailwindcss"; */ @tailwind base; @tailwind components; @tailwind utilities; 로 해도 안되고, @import "tailwindcss"; 도 안됩니다...
본 강의 약 10분 쯤에 나오는 코드 private static boolean contains(LinkedList<Integer>[] buckets, int searchValue) { int hashIndex = hashIndex(searchValue); LinkedList<Integer> bucket = buckets[hashIndex]; for (Integer integer : bucket) { if (integer == searchValue) { return true; } } return false; } 이 부분에서 배열은 각 인덱스의 요소를 하나씩 꺼내는데 LinkedList는 어떤식으로 for-each문을 사용하는지 궁금합니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요, 리액트 학습 중에 궁금한 게 있어서 질문드려요. 기본 path 가 아닌 라우트로 바로 접속을 할때, html을 받으면 라우팅이 이뤄지구 useeffect로 api 요청이 가면서 페이지 렌더링이 이뤄지는건가요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 아니오 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예 중급2편 수강 전 문의 한번만 확인 부탁드려요 ㅠㅠ [질문 내용] 여기에 질문 내용을 남겨주세요.
getPostRecommend() 함수 내부에서 tags : ['post', 'recommends'] 로 설정이 되어있는데, queryClient.prefetch 함수나, useQuery 함수의 queryKey와 항상 동일하게 일치시켜야 하나요? 불러온 데이터를 캐싱할 경우, react-query에서만 관리를 키를 관리해도 되지 않을까요?
강의를 꾸준히 보고 따라하면서 여기까지 왔는데요 아직 제대로 된 복습보다는 이해가 잘 안되는 부분은 나중에 한번 더 보고 일단 한 바퀴 돌아보자 생각 하며 왔습니다. 반복문에서 도저히 응용이 안돼서 여기까지 넘어왔는데요.. 일단 다 보고 나서 다시 복습 해보는 것이 나을까요? 아니면 반복문으로 돌아가서 이해할 때 까지 복습을 하고 다시 오는 방법이 좋을까요? 자바 공부 하면서 꼭 이해하고 넘어가고 싶었는데 도저히 진도가 안나가다 보니까 방법을 여쭙고 싶습니다.
JPA 와 DB 설정, 동작확인 강의에서 리뉴얼된 메뉴얼을 따라서 진행하고 있는데 24분 34초에 나오는 BasicBinder 와 관련한 로그가 TRACE 레벨인 것 같은데 해당 로그가 찍히지 않습니다. 또한 org.hibernate.SQL 과 관련한 로그도 영상과는 다르게 찍히는데 이유가 뭘까요? p6spy를 적용하여 나오는 결과 로그도 영상과 다릅니다 ( 27분 28초 ) p6spy 를 적용하면서 동일한 쿼리 내용이 2번 찍히는 것 같기도 하고 문제를 모르겠습니다. 2025-03-25T23:48:11.976+09:00 INFO 12200 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2025-03-25T23:48:12.165+09:00 INFO 12200 --- [ Test worker] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:tcp://localhost/~/jpashop user=SA 2025-03-25T23:48:12.168+09:00 INFO 12200 --- [ Test worker] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2025-03-25T23:48:12.225+09:00 INFO 12200 --- [ Test worker] org.hibernate.orm.connections.pooling : HHH10001005: Database info: Database JDBC URL [Connecting through datasource 'p6SpyDataSourceDecorator [com.p6spy.engine.spy.P6DataSource] -> dataSource [com.zaxxer.hikari.HikariDataSource]'] Database driver: undefined/unknown Database version: 2.2.224 Autocommit mode: undefined/unknown Isolation level: undefined/unknown Minimum pool size: undefined/unknown Maximum pool size: undefined/unknown 2025-03-25T23:48:12.864+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : create global temporary table HTE_member(rn_ integer not null, id bigint, username varchar(255), primary key (rn_)) TRANSACTIONAL 2025-03-25T23:48:12.869+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914092869 | took 2ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/jpashop create global temporary table HTE_member(rn_ integer not null, id bigint, username varchar(255), primary key (rn_)) TRANSACTIONAL create global temporary table HTE_member(rn_ integer not null, id bigint, username varchar(255), primary key (rn_)) TRANSACTIONAL; 2025-03-25T23:48:12.976+09:00 INFO 12200 --- [ Test worker] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration) 2025-03-25T23:48:12.988+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : drop table if exists member cascade 2025-03-25T23:48:12.990+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914092990 | took 1ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop drop table if exists member cascade drop table if exists member cascade ; 2025-03-25T23:48:12.990+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : drop sequence if exists member_seq 2025-03-25T23:48:12.991+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914092991 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop drop sequence if exists member_seq drop sequence if exists member_seq; 2025-03-25T23:48:12.995+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : create sequence member_seq start with 1 increment by 50 2025-03-25T23:48:12.996+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914092996 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop create sequence member_seq start with 1 increment by 50 create sequence member_seq start with 1 increment by 50; 2025-03-25T23:48:13.000+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : create table member ( id bigint not null, username varchar(255), primary key (id) ) 2025-03-25T23:48:13.002+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914093002 | took 2ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop create table member ( id bigint not null, username varchar(255), primary key (id) ) create table member ( id bigint not null, username varchar(255), primary key (id) ); 2025-03-25T23:48:13.005+09:00 INFO 12200 --- [ Test worker] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2025-03-25T23:48:13.328+09:00 WARN 12200 --- [ Test worker] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2025-03-25T23:48:13.368+09:00 INFO 12200 --- [ Test worker] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 2025-03-25T23:48:13.881+09:00 INFO 12200 --- [ Test worker] jpabook.jpashop.MemberRepositoryTest : Started MemberRepositoryTest in 4.281 seconds (process running for 5.626) 2025-03-25T23:48:14.568+09:00 DEBUG 12200 --- [ Test worker] org.hibernate.SQL : select next value for member_seq 2025-03-25T23:48:14.589+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914094589 | took 13ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop select next value for member_seq select next value for member_seq; 2025-03-25T23:48:14.685+09:00 INFO 12200 --- [ Test worker] p6spy : #1742914094685 | took 0ms | rollback | connection 4| url jdbc:h2:tcp://localhost/~/jpashop ; OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended 2025-03-25T23:48:14.710+09:00 INFO 12200 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2025-03-25T23:48:14.716+09:00 INFO 12200 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2025-03-25T23:48:14.730+09:00 INFO 12200 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 현재 설정 파일 내용들입니다. spring: datasource: url: jdbc:h2:tcp://localhost/~/jpashop username: sa password: driver-class-name: org.h2.Driver jpa: hibernate: ddl-auto : create properties: hibernate: # show_sql: true format_sql: true logging.level: org.hibernate.SQL: debug org.hibernate.orm.jdbc.bind: trace Junit5를 사용하기 위해서 Junit4를 추가하지 않았습니다. plugins { id 'java' id 'org.springframework.boot' version '3.4.4' id 'io.spring.dependency-management' version '1.1.7' } group = 'jpabook' version = '0.0.1-SNAPSHOT' java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.10.0' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } tasks.named('test') { useJUnitPlatform() }