안녕하세요! 풀 라우트 캐시 이후 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 오류가 발생하는지 알려주시면 감사드리겠습니다!
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
코드팩토리 디스코드에 질문하면 더욱 빠르게 질문을 받아 볼 수 있습니다! [코드팩토리 디스코드] https://inf.run/54jjz - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 새로운 프로젝트를 만들었는데 상단에 no device selected가 뜨면서 강의에서 보여주신것처럼, android기기 목록이 뜨는게 아니라 Chrome(Web), Edge(Web), Windows(desktop), Open android Emulator : Flutter Inflearn Refresh 이렇게만 뜨고 있습니다 왜 저는 강의처럼 디바이스 기기이름이 뜨지 않는걸까요? main.dart에 있는 화면이 뜨지 않습니다
버젼이 달라서인지.. 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 문의하기를 이용해주세요. 갑자기 선수강의에 없었던 정적페이지크롤링 파일이 나오는데 이건 어떻게 해야 하나요. 어디서 참고해야 하나요
안녕하세요. 저는 createCustomToken 에러 로그가 이렇게 뜹니다. 분명 처음부터 끝까지 영상 그대로 했는데 왜그런걸까요? user collection등도 다 활성화 되어있는 상태입니다. createCustomToken jdu0e5j7y993 TypeError: Cannot read properties of undefined (reading 'user') at /workspace/create_custom_token.js:21:21 at /workspace/node_modules/firebase-functions/lib/common/onInit.js:33:16 at AsyncLocalStorage.run (node:async_hooks:338:14) at /workspace/node_modules/firebase-functions/lib/v2/trace.js:18:37 at cloudFunction (/workspace/node_modules/firebase-functions/lib/v1/providers/https.js:53:78) at /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/function_wrappers.js 💯 29 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) GPT한테 물어보면, 이 Cloud Function은 onRequest를 사용하고 있고, 데이터를 request.body.data 로 받도록 작성되어 있습니다. 그런데 실제 요청에서는 request.body에 직접 user 객체가 있거나, data가 빠져있을 가능성이 높습니다. 라고 합니다. GPT가 수정해주는 코드나 밑에 인프런에의 수정코드로 다 해도 DEPLOY부터 실패하네요~~도와주실 수 있으실까요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요, 리액트 학습 중에 궁금한 게 있어서 질문드려요. 기본 path 가 아닌 라우트로 바로 접속을 할때, html을 받으면 라우팅이 이뤄지구 useeffect로 api 요청이 가면서 페이지 렌더링이 이뤄지는건가요?
getPostRecommend() 함수 내부에서 tags : ['post', 'recommends'] 로 설정이 되어있는데, queryClient.prefetch 함수나, useQuery 함수의 queryKey와 항상 동일하게 일치시켜야 하나요? 불러온 데이터를 캐싱할 경우, react-query에서만 관리를 키를 관리해도 되지 않을까요?
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
코드팩토리 디스코드에 질문하면 더욱 빠르게 질문을 받아 볼 수 있습니다! [코드팩토리 디스코드] https://inf.run/54jjz - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. hello_world를 화면에 출력하기 위한 플러터 프로젝트를 생성했는데 바탕화면에 생성한 프로젝트는 문제 없이 빌드가 되는데 바탕화면에 한글로된 폴더를 하나 만들어서 거기에 플러터 프로젝트를 생성하고 빌드하면 xception in thread "main" java.lang.RuntimeException: Could not determine wrapper version. at org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:111) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: java.lang.RuntimeException: No build receipt resource found. at org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:97) ... 1 more Error: Gradle task assembleDebug failed with exit code 1 위와 같은 에러가 발생하는데 안드로이드 스튜디오의 플러터 프로젝트는 원래 프로젝트 생성 경로에 한글이 있으면 안되는 건지 알려주시면 감사하겠습니다! 추가) 혹시 몰라서 플러터 프로젝트가 저장된 경로 위치에 접근하는 폴더 명을 모두 영어로 바꿨음에도 에러가 발생하더라구요 현재는 쌩 바탕화면 아니면 문서에 저장한 프로젝트들만 정상적으로 실행이 되는데 이건 단순히 권한 문제인가요? 만약 바탕화면에 코드팩토리 프로젝트라는 폴더를 만들고 거기에 지금부터 강의에서 진행할 프로젝트를 모아서 저정하고 싶은데 방법 있을까요?
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
코드를 똑같이 따라했는데 innerJoin을 사용할때 category 테이블을 입력하면 에러가 나옵니다. Undefined name 'category'. (Documentation) Try correcting the name to one that is defined, or defining the name. 뭐가 문제일까요?