안녕하세요! 풀 라우트 캐시 이후 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 오류가 발생하는지 알려주시면 감사드리겠습니다!
안녕하세요 선생님. material까지 강의를 들으면서 두 가지 궁금한 점이 생겼습니다. 로컬 서버에서 ctrl+s 하면 자동으로 핫로딩되어 코드 변경사항이 화면에 반영되는 것으로 알고 있습니다. (리액트의 경우는 root부터 리렌더링) 그런데 핫로딩을 했을 때 바로 반영되는 코드가 있고, 직접 브라우저에서 새로고침해줘야 반영되는 코드가 있었습니다. <핫로딩 시 안변함 (only 새로고침으로만 변경사항 반영됨)> material wireframe 적용 camera fov, far 속성 그 외 등등 <핫로딩 시 변함> Geometry 종류 변경 transform 속성 변경 (position, scale, rotation) mesh color 변경 materal 종류 변경 그 외 등등 위와 같은 차이가 발생하는 이유를 잘 모르겠습니다. 내부 동작면에서 뭔가 다른게 있는 걸까요? (three.js 코드를 까보면 좀 명확해지려나요...) Mesh의 정의를 어떻게 내려야할지 잘 모르겠습니다. 아래 두 가지 중 어느 쪽이 더 맞는 설명일까요? Geometry와 material을 감싼 껍데기 Geometry와 material로 이루어진 하나의 물체 또, 종종 3D 모델링에서 정육면체, 삼각형 등을 오브젝트라고 부르는 걸 들은 적 있는 것 같은데, 해당 오브젝트라는 명칭이 맞는 명칭인가요? 그렇다면, Mesh = 오브젝트 라고 부를 수 있을까요? 감사합니다.
어디를 수정해야 할까요? 지금 계속 다시 해보고 있는데 해결이 되지 않습니다ㅠ 앞서 이렇게 했었는데 해결되지 않아 다시 해보고있습니다..! tailwind.config.js 의 content에 이렇게 입력하는게 맞나요?? index.css에 이렇게 오류가 떠서요 ㅠㅠ -> 우측하단 언어모드를 tailwindCSS로 바꾸면 밑줄은 사라지는데 npm start 실행시 이렇게 뜹니다..!
버젼이 달라서인지.. 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"; 도 안됩니다...
from langchain.retrievers.document_compressors import DocumentCompressorPipeline from langchain_community.document_transformers import EmbeddingsRedundantFilter # 중복 문서 제거 redundant_filter = EmbeddingsRedundantFilter(embeddings=embeddings_model) # 쿼리와 관련성이 높은 문서만 필터링 relevant_filter = EmbeddingsFilter(embeddings=embeddings_model, similarity_threshold=0.5) # Re-ranking re_ranker = LLMListwiseRerank.from_llm(llm, top_n=2) pipeline_compressor = DocumentCompressorPipeline( transformers=[redundant_filter, relevant_filter, re_ranker] ) pipeline_compression_retriever = ContextualCompressionRetriever( base_compressor=pipeline_compressor, base_retriever=chroma_db.as_retriever() ) question = "테슬라 회장은 누구인가요?" compressed_docs = pipeline_compression_retriever.invoke(question) print(f"쿼리: {question}") print("검색 결과:") for doc in compressed_docs: print(f"- {doc.page_content} [출처: {doc.metadata['source']}]") print("-"*100) print() `(4) DocumentCompressorPipeline` - 여러 압축기를 순차적으로 결합하는 방식 - BaseDocumentTransformers를 추가하여, 문서를 더 작은 조각으로 나누거나 중복 문서를 제거하는 등의 작업도 가능 여기에서 result = chain.invoke() 로 받아서 result의 데이터를 보면, context = result['context'][i] query_similarity_score = context.state['query_similarity_score'] 이렇게 similarity_score 처럼 rerank score같은거 보고싶은데, # 크로스 인코더를 사용하여 유사성 점수를 계산합니다. sentence_pairs = [[query, prediction]] similarity_scores = cross_encoder_model.predict(sentence_pairs) 이런식으로 계산을 해야하나요? 추출하고 싶은데 방법을 잘 모르겠습니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 갑자기 선수강의에 없었던 정적페이지크롤링 파일이 나오는데 이건 어떻게 해야 하나요. 어디서 참고해야 하나요
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요, 리액트 학습 중에 궁금한 게 있어서 질문드려요. 기본 path 가 아닌 라우트로 바로 접속을 할때, html을 받으면 라우팅이 이뤄지구 useeffect로 api 요청이 가면서 페이지 렌더링이 이뤄지는건가요?
getPostRecommend() 함수 내부에서 tags : ['post', 'recommends'] 로 설정이 되어있는데, queryClient.prefetch 함수나, useQuery 함수의 queryKey와 항상 동일하게 일치시켜야 하나요? 불러온 데이터를 캐싱할 경우, react-query에서만 관리를 키를 관리해도 되지 않을까요?
혹시 현재 25년 3월기준 이 강의를 들으면 리액트 버전 차이로 인해 렌더링 방식이라던지 다른 점이 있어서 수강할때 불편할까요? - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.